Функция Jplayer Ready не запускается с помощью flash-решения
Я использую Jplayer (2.2.0 и JQuery 1.6) для воспроизведения аудио файлов в моем приложении. АудиоS должен использовать флэш-решение. Но когда опция решения установлена во флэш-памяти, функция готовности не срабатывает, и, следовательно, при воспроизведении файла возникает ошибка.
Когда гуглил эту проблему, было рекомендовано проверить путь к файлу .swf. Путь правильный. Это было дважды проверено на вкладке Newtwork (инструмент разработчика Chrome). На вкладке сети файл .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);
});
});
<a href="javascript:;" class="jp-play" tabindex="1">play</a>
<a href="javascript:;" class="jp-pause" tabindex="1">pause</a>
<a href="javascript:;" class="jp-stop" tabindex="1">stop</a>
<a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a>
<a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a>
<a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a>
<a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a>
<a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a>
Cro Magnon Man
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>