XML driven FLV Player by eckert
You may have checked out THIS FIX to getting an FLV on your site, but now you want to pull data from an XML file. Why would you want to do this? Perhaps you want to add pre- or post-roll commercials with your video. Maybe you want more than one video to play.
Remember to get the flvplayer.swf first.
Here’s the embed code -
<embed src="http://yourdomain.com/flvplayer.swf" width="480" height="360" allowscriptaccess="always" allowfullscreen="true" flashvars="height=360&width=480&file=http://yourdomain.com/yourplaylist.xml&displaywidth=480&autostart=false&shuffle=false&playlist=false&scroll=true" />
Once again, you can modify any of the variables (height, width, autostart). I have the display set so that it will hide the playlist.
Now for the xml playlist, you need to have your XML file and your FLV’s in the same folder. The XML needs to be formatted like this -
<?xml version='1.0' encoding='UTF-8'?> <playlist version='1' xmlns='http://xspf.org/ns/0/'> <trackList> <track> <location>http://yourdomain.com/folder/video1.flv</location> </track> <track> <location>http://yourdomain.com/folder/video2.flv</location> </track> <track> <location>http://yourdomain.com/folder/video3.flv</location> </track> </trackList> </playlist>
You can have as many or as few “tracks” as you’d like. Just modify the XML to reflect that.
Tags: commerical, Flash, flv, player, playlist, swf, video, xml
December 11th, 2009 at 3:44 am
not working .. video play but no image display
March 3rd, 2010 at 1:15 pm
I get it to auto-play but then it stops after the first video and when I click play again it plays the same video again. I can hit fast forward to skip to the next video, but I would like for it to be an auto-transition… What am I doing wrong?
April 8th, 2010 at 9:29 pm
that’s interesting, I have not had the same problem before. if i am able to reproduce it, I’ll let you know.
October 6th, 2010 at 11:16 am
the best video player that i use is none other than VLC Player, it is free and i think it is open source too~,;
July 26th, 2011 at 1:44 am
not working !