Network Media Player

Network Media Player

After having lived with Windows Media Player on my HTPC for the last two years, I have been looking for an alternative that will allow control via a suitable web browser so that video and in particular audio can be selected from either a laptop or a web enabled mobile phone. To my surprise, I only found two media players with a web interface, VLC and Media Player Classic/Home Cinema which is odd given the rise in home network media streaming.

Given that one of the requirements of the software is compatibility with Reclock so that kernel streaming can be enabled for bit perfect audio, Vlc can be ignored leaving only Media Player Classic/Home Cinema as a viable option. Media Player Classic/Home Cinema is an excellent media player but there is no real easy option of playing multiple audio files or selecting an album to play, however it does support playlists which adds a bit more flexibility.

Media Player Classic/Home Cinema has its own web server, so it is very simple to activate once you have chosen where to run it from and on what port. The interface supplied with MPC has a working web based player (/player.html) which is constantly updated via javascript from a status page (/status.html). The player allows a file to be selected via a text based browser page (/browser.html) and then cued up to play. Commands to play, pause and navigate media files can be sent to a command page (/command.html).

Although the web interface works ok, it lacks a good graphical user interface and the option to play multiple files, therefore a little work is required to improve things.

My solution is to run a second web server on port 80 using Windows IIS (bundled with XP/Vista) so that active server pages can be utilised to add more functionality and be able to create dynamic M3U playlists. The other advantage of using active server pages is that a Windows Shell Application can be called to access the mp3 and WMA meta tags via the Windows Namespace. There are third party objects such as CDDBControl to read ID3 tags but this only works with MP3. Furthermore by installing the excellent TagLibHandler, you can access .aac, .mp4a, .flac and .ape tags as well albeit in read only format, which is fine because that is all that is required. There are plenty of apps on the internet dedcated to renaming audio file so there is no point in developing something to edit tags that has been done before.

All that is then required is to loop through a folder path and read the meta tags from audio files and sort into an array so that they can be displayed in a browser with a relevant link to play the track. I also added some script to look for a folder.jpg so that the folders can display artwork and a second much larger artwork image. One of the real hates of Windows Media Player is its auto resizing of the folder.jpg file (which Microsoft classes as a system file) to 200px, so by using a second image I can customize artwork to my personal preference.

When a track is selected, it is sent it to a dynamic page that builds an .m3u file containing all the files in the folder that contains the sent track, so that if track number 1 is passed, it will play the whole folder contents or if say track 5 is selected, it will play tracks 5 and onwards in that folder.

So far the system has worked very well, and navigating and playing files has been very easy but of course the system is really dependent on a proper artist/album folder structure and complete meta tags but this can easily be achieved with a little time and effort. There is currently no search feature as I just want to navigate, rather than search and this has the added advantage that I can easily access an external drive of tracks without having to build a media library first.

With the advent of Nework music players like Sonos, this alternative was a challenging and rewarding project, but it is the practicality of the finished product that is the most satisfying.

folders.jpgalbum.jpg

This entry was posted on Wednesday November 25th, 2009 at 3:00 PM and is filed under Home Cinema. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response.

Leave a Reply





captcha

Subscribe to RSS feed