I’ve been writing a little playlist generator for my own use. One of the things I wanted it to do was generate a list and play it without saving the list. The way to do this is to have Windows Media Player make a TCP/IP connection the playlist generator (when you connect this way WMP stores the entire playlist in memory, while if you load form a temp file it expects that temp file to remain as long as it is playing the list).

So, I have the playlist generator act as a little web server selecting a random free port then telling the OS to open a URL based .asx file which also means the default player will be started. Simple idea that should have worked. Well, it didn’t. I could open the playlist in telnet. I could open the playlist in Notepad, if I changed the content type I could look at the playlist in IE, but WMP steadfastly reported a network error.

This was becoming a real stumper and not worth the time to play with, however, I’m very stubborn.

Now the playlist generator appears like a web server but since it only sends out that one playlist it generates it ignores the GET command and always sends out the same stream no matter what connects to it.  Therein lies the problem. If you open http://localhost:1234/ then a proper server redirects the client to a specific page such as http://localhost:1234/default.htm. WMP player was looking for a file with an .ASX extension so http://localhost:1234/ to get the playlist just didn’t work. The solution was to tell it via the OS to ask for a random .ASX file like PL%RANDOM%.asx. The generator didn’t care about filenames but it made WMP happy so it now works as expected.

I can only assume that this insistence on having a filename has something to do with it storing the list in TIF. I don’t know but that’s the guess.

This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s