PDA

View Full Version : Make a single FLV player to play several videos with playlist



jenniferrung
11 Dec 2009, 12:48 AM
I know you might see this post on some other forums before, but I still think I should share it with you at here.

If you want to play several videos on a single player, this is the right guide for you to get it done with the following sample HTML code. It is no more a difficult task to embed playlsit file with videos and player on web page. This article is based on Moyea PlayerBox. But the code and FlashVars are suitable for any web players.

When you published the web player with Moyea PlayerBox, you will get these files:

1. christmas_player.swf is the web FLV player with playlist component
2. myPlayer.mmpl is the playlist file with items for the player to display
3. and the moyea.jpg available in the folder named "myPlayer.playlist" could be used as the first frame image before the video start playing. The folder myPlayer.playlist includes flash videos and thumbnails for the playlist items

Here is the sample HTML code for you.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="480" height="400">
<param name="movie" value="christmas_player.swf">
<param name="FlashVars" value="playList=myPlayer.mmpl&firstFrame=myPlayer.playlist/moyea.jpg">
<param name="quality" value="high">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="True" />
<embed src="christmas_player.swf" FlashVars="playList=myPlayer.mmpl&firstFrame=myPlayer.playlist/moyea.jpg" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="400" allowScriptAccess="sameDomain" allowFullScreen="True">
</embed>
</object>

If you put the html file, swf file and the mmpl file to the same folder when uploading to your server just like how you get the pack, the above coding is enough for you. You can change the flash video file name as you like and change christmas_player to the player file name you get. Please note that the changes shall apply to both the OBJECT tag and EMBED tag.

If you want to put the three files into different directory, you may modify the HTML code. For example, you put the html file to a folder named "page", the mmpl file and the myPlayer.playlist folder to a folder named "list", and do not change the location of the swf file. You shall change the swf file path according to the html file, and the playlist file path according to the swf file, the first frame image file path according to the swf file, because the html file shall read the swf file, and the player file shall recognize the playlist file and the first frame image file. Thus, the HTML code should go as follow after changing the file locations.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="480" height="400">
<param name="movie" value="../christmas_player.swf">
<param name="FlashVars" value="playList=list/myPlayer.mmpl&firstFrame=list/myPlayer.playlist/moyea.jpg">
<param name="quality" value="high">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="True" />
<embed src="../christmas_player.swf" FlashVars="playList=list/myPlayer.mmpl&firstFrame=list/myPlayer.playlist/moyea.jpg" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="400" allowScriptAccess="sameDomain" allowFullScreen="True">
</embed>
</object>

Note: The code ../ is added because the files are in different folders. HTTP URL is supported too. You can also change the location of the flash videos instead of the myPlayer.playlist folder. For more FlashVars (http://www.player-box.com/guide/supported_flash_variables.html) .

If you want to play a single video on player or do not want to show the playlist, you can delete the playlist component from the player by editing the player template, and use videoFile parameter to read single flash video, instead of playList parameter.

You also can find some web player template to use directly from the Christmas activity (http://www.video-to-flash.com/news/news_091210.html) page.