如何为支持播放列表的YouTube视频实施高级视频播放器(javascript / jquery / flash)? 是否有一些很好的开源脚本,我可以修改。
我希望播放器类似于jukesy.com或grooveshark.com上使用的播放器。
提前致谢
答案 0 :(得分:1)
示例中的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'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>