Make a single FLV player to play several videos with playlist

Discussion in 'HTML & Website Design' started by anllyy, Dec 10, 2009.

  1. #1
    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>
    Code (markup):
    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>
    Code (markup):
    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 .

    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 page.
     
    anllyy, Dec 10, 2009 IP
  2. biscayne

    biscayne Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Thanks for sharing such a very useful code....
     
    biscayne, Dec 11, 2009 IP
  3. anllyy

    anllyy Peon

    Messages:
    211
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you are welcome biscayne. if you have any question about this post please let me know.
     
    anllyy, Jan 3, 2010 IP
  4. rubthewebbb

    rubthewebbb Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you very much for this information about making single flv player to play several videos.

    Thanks.
     
    rubthewebbb, Jan 3, 2010 IP