2011-12-04 43 views
0

如何爲支持播放列表的YouTube視頻實現高級視頻播放器(javascript/jquery/flash)? 有沒有一些很好的開源腳本,我可以修改。針對YouTube視頻的高級jQuery/Flash播放器

我想播放器與jukesy.com或grooveshark.com上使用的播放器相似。

預先感謝

回答

1

Check out this example.

Playlist.xml從例如:

<rss version="2.0" 
    xmlns:jwplayer="http://developer.longtailvideo.com/trac/" 
    xmlns:media="http://search.yahoo.com/mrss/"> 
    <channel> 
    <title>Playlist with Thumbnails</title> 
    <item> 
     <title>Big Buck Bunny Trailer</title> 
     <media:content url="/videos/bunny.mp4" /> 
     <media:thumbnail url="/thumbs/bunny.jpg" /> 
     <jwplayer:playlist.image>/thumbs/bunny_small.jpg</jwplayer:playlist.image> 
     <jwplayer:duration>33.03</jwplayer:duration> 
    </item> 
    <item> 
     <title>Sintel</title> 
     <media:content url="/videos/sintel.mp4" /> 
     <media:thumbnail url="/thumbs/sintel.jpg" /> 
     <jwplayer:playlist.image>/thumbs/sintel_small.jpg</jwplayer:playlist.image> 
     <jwplayer:duration>888.06</jwplayer:duration> 
    </item> 
    <item> 
     <title>Elephant&#39;s Dream</title> 
     <media:content url="/videos/elephant.mp4" /> 
     <media:thumbnail url="/thumbs/elephant.jpg" /> 
     <media:thumbnail>/thumbs/elephant.jpg</media:thumbnail> 
     <jwplayer:playlist.image>/thumbs/elephant_small.jpg</jwplayer:playlist.image> 
     <jwplayer:duration>653.79</jwplayer:duration> 
    </item> 
    </channel> 
</rss> 

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script> 
從示例

嵌入代碼:

<div id='mediaplayer'></div> 

<script type="text/javascript"> 
    jwplayer('mediaplayer').setup({ 
    'flashplayer': 'player.swf', 
    'id': 'playerID', 
    'width': '650', 
    'height': '240', 
    'playlistfile': 'playlist.xml', 
    'playlist.position': 'right', 
    'playlist.size': '250' 
    }); 
</script>