Credits & Shouts
Obvious gratitude is due to rodejo16. Without his excellent Navi-X script for XBMC, this site would be pretty pointless.
The first thing you probably noticed about this site is the blatant thievery of Jezz X's Project Mayhem III skin elements. Most of the images on this site are at least derived from PM3, and some of them are used as-is from the XBMC SVN (like the animated pulsating current-page indicator in the main site menu). I like to think of this as more of a tribute than a robbery - although it did make coming up with the site theme a whole lot easier.
For playing back several media formats, the simulator uses JW Media Player written by Jeroen Wijering. You’ve probably seen this flash player all over the internet without even realizing it, and there's a reason - it rocks.
Flash elements in the simulator are inserted dynamically using Geoff Stearns’ SWFObject script. If you’re going to put flash in a page, this is the way to do it.
Last but definitely not least, shouts go out to Gregory Wild-Smith for his ultra-handy Simple AJAX Code-Kit (SACK). It makes bullet-proof AJAX coding a breeze.
Playlists are broken down and split up into individual list entries and then stored in a database. This allows the system to verify them one by one, and to generate PLX data on-the-fly showing only valid links. It is also what allows the system to track who owns what so that your playlists can be edited only by you.
A lot of work has gone into trying to make everything here work in Firefox, IE, Google Chrome, and Safari.
The verification process involves retrieving the HTTP header for an entry's URL, then aborting the transfer. This allows verification to happen very quickly while not burning much bandwidth. Keep in mind that it's not very smart - it doesn't tests like making sure that an entry marked as a video is really a video, only that there is something reachable at the URL.
Every entry's URL is tested once every 24 hours. If an entry fails, nothing is done right away - it is tested again 30 minutes later. If it fails this 2nd test, it is flagged as a dead link and hidden within its playlist. Links marked as dead are retested every 24 hours along with everything else. If it miraculously comes back to life, it becomes visible again.
If all of the media entries in a playlist die and the playlist doesn't contain any playlist entries, the list is also hidden. Since the list is generated on-the-fly, it becomes visible again as soon as it contains any working links.
Even though verification happens automatically, entries can be manually retested from the “My Playlists” area while viewing/editing a list. You can manually test a single entry by clicking in the entry's action column. Clicking the “Re-test all” button will do just that.
The server-side simulator code was written using Navi-X's Python source code as a guide, but is written entirely in Perl using very different methods for scraping playlist data from PLX, RSS, Youtube, Shoutcast, Flickr, Apple movie, etc. Instead of finding the index of substrings and calculating resulting string from index & length, it uses regular expressions exclusively. I'm not sure about the performance of these in XBMC Python, but they rock in Perl.
As mentioned on the home page, it was not originally intended to be a simulator - only a background / thumbnail / logo previewing tool. But, I was having so much fun making it, I just kept going. It is not nearly as functional as an actual XBMC/Navi-X installation, but it does have enough functionality to make it fun to play with. Unfortunately, there is no cross-platform mplayer browser plugin, so the sim has to resort to using a flash media player, Quicktime, and Windows media plugins as needed. In order to view the widest variety of media that sim can handle, you need to have Flash, Quicktime, and WMP plugins installed for your browser. Currently, here is how media handling is divied up:
gif, jpg, png, txt- handled by the browser, of course.
avi, xvid- DivX Web Player (not detected)(unknown - can't test IE)
flv, mp4, m4v- JW Media Player (flash plugin not detected)
mov, mpg, mpeg- Apple Quicktime browser plugin (not detected)
wmv, asf, asx, mms- Windows Media Player browser plugin (not detected)
mp3, m4a- JW Media Player (flash plugin not detected)
A note on mp4 playback: While XBMC can stream just about anything, flash is a little more picky. Mp4s will only stream in the sim if they were encoded using “hinting”. An mp4 encoded for a podcast should have this anyway, but some don't. Without it, the player will appear to just hang, but it’s really just downloading the whole thing before starting playback. (ick)
When I first started using Navi-X, I was excited to see the user- submitted media from Navi-Xtra. But, browsing through the stuff that was posted, I got frustrated pretty quickly at all of the broken links. Viewing some of the lists’ source showed that there were some typos like using “playlists” instead of “playlist”, improperly formatted URLs, etc. These were making things not work and, sometimes, even locking up XBMC.
While one of the main features of Navi-X is to make it easy to create playlists, I figured it would be even better if users had a place to go where they could not only host their playlists, but edit them through a GUI, and have the links checked now and then to make sure they were still good.
As a long-time web programmer as well as a long-time XBMC enthusiast, I really had no choice but to build this site. It's the least I could do to try to give a little back to the community after getting so much out of it for so long.
If you have any comments or suggestions, I'd love to hear them. Please leave your comments in the forums.