People who know me well, know that I have a horrendously large collection of music videos. They are in all sorts of formats(avi/mpg/dat) and all sorts of file names (chinese/japanese/eng). Now I’ve tried many many media players that’s suppose to keep my whole list of mvs and play them randomly. None of them really works well. Either they crash because of the file name or they just can’t handle the format switching very well. Windows media 9 + works really well, but I hate it’s hot key config and stupid skins. So I decided to make use of the good old mediaplayer 6.4. It’s still the best player I’ve ever used, doesn’t use much resources, pops right up when you call it even on low end hardware.
So onward to making the playlist. Mediaplayer since I don’t remember when has use asx to stream media file. It’s basically just a xml text file. Next we will get a list of all the files in the mv directory. Several ways you can do it, but I have cygwin installed, so I’m gonna do it the linux way. To get the list, we will use regular expressions (finally, some practical use for it) type "ls -F | egrep ‘.*[^/]$ > list.txt’"
If you dont’ understand it, then you can just type the filenames out by hand. At this point, you should look into MSDN to see the specs of the asx format. I’m a bit lazy and just want it to work, so everything is wrapped within a asx tag. Within that, every entry is in it’s own entry tag. And within an entry tag, I put in a title tag just to see which file is playing, and a ref tag to tell the player where the file is. That’s pretty much it. Save the file, name it whatever.asx and drop it in mediaplayer.
I haven’t worked in the random part, but it shouldn’t be too difficult. I’d probably do a sort or some kind after the egrep pipe.
Well, there you go, a very stable media player with a list of all your (my) music videos. now back to studying. That’s right, I have 2 exams tomorrow yet I can’t help but to make the play list. (my mind also floated away for a while and wrote a tutorial on how to fake camera focus in a 3D enviroment with the least rendering work, man….I really should be getting back to studying)