2013-02-18 85 views
0

嗨,夥計們我已經嘗試幾乎所有關於這個問題,並嘗試在這個論壇上的每一個解決方案,仍然無法找出解決這個問題的解決方案。儘管給出了正確的swf路徑,但我無法播放來自Jplayer的mp3文件。文件都打在Chrome和IE瀏覽器,但在Firefox中沒有Jplayer儘管所有的努力沒有在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}); 

    } 
} 
+0

是否有任何javascript錯誤? – 2013-02-18 17:33:07

回答

0

注意以下行執行腳本:

swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf", 

我以前看過人們這樣做,這是有問題的。這是我的建議

  • 下載的SWF文件
  • 將其放置在你有你的jPlayer
  • 更改JavaScript的swfPath指向該位置的目錄 - 由於沒有指定的SWF文件的名稱

因此,舉例來說,假設你有一個像目錄/ JS/jplayer - 下載的SWF到那裏...然後改變你的代碼:

swfPath: "/js/jplayer" 
0

謝謝你們disqus插件導致了這個問題。當我刪除它時,播放器開始工作正常。再次感謝

相關問題