Got an e-mail from David this morning asking how I did the “Now Playing” sidebar item on my blog. I originally did all this work for integrating Radio Userland and Windows Media Player. That is how I stumbled onto this solution. If you don’t use Windows Media Player, this won’t help you. Sorry. I switch around my players so maybe I will investigate others someday. But this was just the first and easiest one to get going. Anyway, here is what you do:
1. Download the SongWriter plug-in for Windows Media Player. Follow the instructions on their web site for getting the plugin to work.
2. I setup the plug-in to publish my song information in a text file, songout.txt, to a music directory on my web site. Be sure its publishing the artist, album, song title, and small picture for my example code to work. Please verify that you get all this working by looking for the file on your web server.
4. Then, the final step is to integrate the “Now Playing” entry into your main template, or wherever you want it. Do this by including a script reference to that PHP file you created back in step 3. Mine looks like:
And that’s it. Your “Now Playing” entry on your home page will update very quickly after Windows Media Player switches songs. No page rebuilding necessary!