我目前使用的是JWplayer 6,我发现JWPlayer 5和6在配置上存在“差异”。
有谁知道如何设置JWPlayer 6的主和后备?
out.println("<div id=\"myElement\">Loading the player...</div>");
out.println("<script type=\"text/javascript\">");
out.println("jwplayer(\"myElement\").setup({");
out.println("sources:[");
out.println("{'file': \"rtmp://s2y3u5i4t1fkbz.cloudfront.net:1935/cfx/st/mp4:XXXXX.mp4\"},");
out.println("{'file': \"http://dkgitv33rxgy.cloudfront.net/XXXXX.mp4\"},");
out.println("],");
out.println("width: \"720\",");
out.println("height: \"480\"");
out.println("});");
out.println("</script>");当我转到我的PC浏览器并查看我的网站时,它无法显示。然而,如果我使用我的iphone,它会显示。如果我注释掉http,我的浏览器可以显示视频,但我的iphone不能。如果我注释掉rtmp,我的iPhone就可以播放视频了。
以前有没有人遇到过这个问题?
谢谢
编辑:在宽度720之前和之后使用'primary':'flash‘(右方括号)。它可以在PC和手持设备上使用stream和HTML,WOOHOO!
发布于 2013-06-04 23:36:59
试试这个,它可以在JwPlayer 6.3上运行。
jwplayer("<?php echo $this->id?>").setup({
autostart: 'true' ,
flashplayer: "<?php echo CHtml::asset($this->_path.'/jwplayer.flash.swf')?>",
width:<?php echo $this->width?>,
height:<?php echo $this->height?>,
playlist: [{
sources: [
{
//Desktop: Use RTMP protocol and played by flash.
file: "<?php echo $this->rtmpPath;?>"
},
{
//Mobile: Use HLS protocol and played by HTML5
file: "<?php echo $this->hlsPath;?>",
}
]
}],
primary:"flash",
});https://stackoverflow.com/questions/16096180
复制相似问题