我喜欢新的jwplayer 6,我有商业版,所以我可以为它打造品牌。我使用版本5获得了我想要的一切(包括捕获'onplaylistITme'事件) - 但现在是时候将其移至6以获得wder兼容性和徽标显示。
这是在jwPlayer 5代码上运行的播放器。请注意顶部显示的歌曲标题。
<小时/> version 5 of jwPlayer - this shows what I want创建的事件
<div id="playlistiteminfo"></div>
<div id="container" ></div>
<script type="text/javascript">
jwplayer("container").setup({
'flashplayer': '<?rev put gPlayerParamsA[jwplayerSWF] ?>',
height: <?rev put gPlayerParamsA[playerHeight] ?>,
width: <?rev put gPlayerParamsA[playerWidth] ?>,
logo: {
file: '<?rev put gPlayerParamsA[watermarkLoc] ?>',
link: 'http://barncard.com'
},
'playlist': [{
<?rev
put tPlayListP -- JAVASCRIPT PLAYLIST CREATED EARLIER INSERTED HERE
?>
}],
'playlist.position': "<?rev put gPlayerParamsA[playListPosition] ?>",
'playlist.size': <?rev put gPlayerParamsA[playListSize] ?>,
'controlbar.position': 'bottom',
skin:'<?rev put gPlayerParamsA[skinSWF] ?>',
repeat: 'list',
events: {
onPlaylistItem: function(evt) {
var playlistitem = this.getPlaylistItem();
var infodiv = document.getElementById("playlistiteminfo");
infodiv.innerHTML = "";
infodiv.innerHTML += playlistitem.title;
}
}
});
<?rev
if gPlayerParamsA["single_play_index"] is a number
then
?>
jwplayer().playlistItem(<?rev put gPlayerParamsA["single_play_index"] ?>);
<?rev
end if
?>
</script>
转到版本6打破了很多东西,语法更简单,更清晰但不同但我能够让它全部恢复工作,除了上面列出的事件代码。应该注意的是,我使用的是Livecode服务器端而不是PHP,但没有问题。
<hr>
<HR>
<div id="container" ></div>
<script type="text/javascript">
jwplayer("container").setup({
height: <?rev put gPlayerParamsA[playerHeight] ?>,
width: <?rev put gPlayerParamsA[playerWidth] ?>,
logo: {
file: "<?rev put gPlayerParamsA[watermarkLoc] ?>",
link: "http://barncard.com",
position: "bottom-left"
},
playlist: [{
<?rev
put tPlayListP -- JAVASCRIPT PLAYLIST CREATED EARLIER INSERTED HERE
?>
}],
displaytitle: "false",
listbar: {
position: "right",
size: <?rev put gPlayerParamsA[playListSize] ?>,
}
});
<?rev
if gPlayerParamsA["single_play_index"] is a number
then
?>
jwplayer().playlistItem(<?rev put gPlayerParamsA["single_play_index"] ?>);
<?rev
end if
?>
</script>
因此,当我在postion:“right”之后将此代码段添加到上面的代码中时,它会破坏整个播放器并且无法正常工作。
repeat: 'list',
events: {
onPlaylistItem: function(evt) {
var playlistitem = this.getPlaylistItem();
var infodiv = document.getElementById("playlistiteminfo");
infodiv.innerHTML = "";
infodiv.innerHTML += playlistitem.title;
}
所以
我希望有人在那里成功地完成了这项工作或有一个解决方法......
非常感谢任何帮助或更正的代码..
这是我在SO上的第一篇文章。谢谢你的资源。
stephen barncard
答案 0 :(得分:0)
在JW6中,更改:
repeat: 'list',
要:
repeat: 'true',
这应该可以解决问题。