jquery jplayer闪存回退不工作
我有一个jQueryJPlayer,它的html版本工作得很好。当我尝试加载flash版本作为默认版本时,它停止工作 当我加载页面时,Chrome控制台两次显示错误“PPB_Graphics2D.PaintImageData:矩形超出边界”。Firefox没有显示任何JS错误 这是jQuery代码jquery jplayer闪存回退不工作,jquery,jplayer,Jquery,Jplayer,我有一个jQueryJPlayer,它的html版本工作得很好。当我尝试加载flash版本作为默认版本时,它停止工作 当我加载页面时,Chrome控制台两次显示错误“PPB_Graphics2D.PaintImageData:矩形超出边界”。Firefox没有显示任何JS错误 这是jQuery代码 $("#jquery_jplayer_1").jPlayer({ solution:"flash, html", play: function
$("#jquery_jplayer_1").jPlayer({
solution:"flash, html",
play: function() { // To avoid both jPlayers playing together.
$(this).jPlayer("pauseOthers");
},
ready: function () {
$(this).jPlayer("setMedia", {
mp3: "http://test.com/music.mp3"
});
},
swfPath: "player/jplayer",
supplied: "mp3",
cssSelectorAncestor: "#jp-audio-container1"
});
如果我将解决方案转换为解决方案:“html,flash”,则播放器工作正常。
这是脚本生成的flash播放器:
<embed name="jp_flash_0" id="jp_flash_0" src="player/jplayer/Jplayer.swf" width="0" height="0" bgcolor="#000000" quality="high" flashvars="id=jquery_jplayer_1&vol=0.8&muted=false" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="width: 0px; height: 0px; ">
已验证mp3 url是否正常工作。我还验证了(使用Chrome网络)JPlayer.swf文件路径是正确的,并且可以从上面的代码访问
原因可能是什么?看起来“PPB_Graphics2D.PaintImageData:Rectangle是外部边界”的错误通常是由Chrome的PepperFlash插件引起的。一些解决方案建议禁用它。那对我不起作用
经过大量搜索,我下载了一个新的jquery.jplayer.min.js解决了这个问题。不知道另一个出了什么问题
[编辑]在开发过程中,我又遇到了这种情况。记下结果,为其他有同样问题的人着想。我使用了Chrome Flash插件的调试版本来解决这个问题。错误是因为在“swf”属性中指定的相对URL上找不到JPlayer。在花了相当长的时间使用jPlayer之后,在发生swf错误时需要检查的两件事是——swf路径和jPlayer.swf的版本