使用闪存解决方案无法触发Jplayer Readyfunction

我正在使用Jplayer(2.2.0和jquery 1.6)在我的应用程序中播放音频文件。 音频必须使用闪存解决方案。 但是当解决方案选项设置为闪存时,不会触发就绪function,因此当我播放文件时会出现错误。

当googgled为这个问题时,推荐的解决方案是检查.swf文件的路径。 路径是正确的。 通过Newtwork选项卡(chrome developer tool)对此进行了双重检查。 在网络选项卡中,下载.swf文件时没有任何错误。

 jQuery.noConflict(); jQuery(document).ready(function(){ jQuery("#jquery_jplayer_1").jPlayer({ ready: function () { jQuery(this).jPlayer("setMedia", { mp3: "http://www.happyworm.com/audio/mp3/Miaow-07-Bubble.mp3" }).jPlayer("play",40); }, swfPath:"js/", ended: function (event){ jQuery(this).jPlayer("play",20); }, supplied:"mp3", solution:"flash,html", volume: .50, wmode:"window" //preload: 'auto' }); jQuery("#jquery_jplayer_N").bind(jQuery.jPlayer.event.error, function (event) { switch (event.jPlayer.error.type) { case jQuery.jPlayer.error.URL: console.log("error file"); break; case jQuery.jPlayer.error.NO_SOLUTION: // Do something console.log("NO_SOLUTION"); break; } console.log(event.jPlayer.error.type); }); }); 

     

检查你的风格。 如果您的#jquery_jplayer_1或其父级的display = none,则ready事件永远不会在诸如opera或firefox之类的浏览器中触发。 我的意思是flash对象无法隐藏。