嗨,伙计们,我已经尝试了几乎所有关于这个问题的方法,并尝试了这个论坛上的所有解决方案,但仍然无法找出这个问题的解决方案。尽管提供了正确的 swf 路径,但我无法从 Jplayer 播放 mp3 文件。文件在 chrome 和 IE 中播放,但不是 firefox
<script>
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
mp3:"<?php echo Zend_Registry::getInstance()->constants->img_profilepath . $this->acc->Username . '/' . Zend_Registry::getInstance()->constants->img_albumpath . '/' . $this->album->Id . '/' . Zend_Registry::getInstance()->constants->audio_path . '/' . $this->playsong->Id . $this->playsong->Audio; ?>"
}).jPlayer("play");
},
swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
solution:"html,flash",
supplied: "mp3",
cssSelectorAncestor: ""
});
document.getElementById("track-title").innerHTML='<h6 class="subheader"><marquee><?php echo$this->playsong->Title;?></marquee></h6>';
});
</script>
这是播放媒体时执行的脚本
function play(url,title,songid)
{
$("#jquery_jplayer_1").jPlayer("setMedia",
{
mp3: url
});
$("#jquery_jplayer_1").jPlayer("play", 0);
document.getElementById("track-title").innerHTML='<h6 class="subheader"><marquee>'+title+'</marquee></h6>';
$.post('/audioplayer/played',
{'songid' : songid});
}
}