2012-12-21 68 views
1

設置 在我的網站上安裝了Soundmanager2。自動生成到MP3的鏈接。Soundmanager2加載但不玩

的問題 使用360-UI,我看到了聲音加載,因爲它起着就像這個演示的左上角動畫(http://www.schillmania.com/projects/soundmanager2/demo/ 360玩家/),但它不玩,秒計數器不移動。

我怎麼加載PLAYER

<link rel="stylesheet" type="text/css" href="/css/360player.css" /> 
<link rel="stylesheet" type="text/css" href="/css/flashblock.css" /> 
<!-- special IE-only canvas fix --> 
<!--[if IE]><script type="text/javascript" src="/js/excanvas.compiled.js"></script><![endif]--> 

<!-- Apache-licensed animation library --> 
<script type="text/javascript" src="/js/berniecode-animator.js"></script> 
<script type="text/javascript" src="/js/soundmanager2.js"></script> 
<script type="text/javascript" src="/js/360player.js"></script> 

<script type="text/javascript"> 
soundManager.setup({ 
    // path to directory containing SM2 SWF 
    url: '/swf/', debugMode: true 
}); 
</script> 

調試代碼

-- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: true, wav: true -- soundmanager2.js:1155 
-- SoundManager 2 V2.97a.20121104 (AS3/Flash 9) + HTML5 audio, high performance mode, normal polling, wmode: transparent, flashBlock mode -- soundmanager2.js:1155 
soundManager::createMovie(): Trying to load /swf/soundmanager2_flash9_debug.swf soundmanager2.js:1155 
soundManager::initMovie(): Waiting for ExternalInterface call from Flash... soundmanager2.js:1157 
soundManager::externalInterfaceOK() (~2 ms) soundmanager2.js:1157 
soundManager::init() soundmanager2.js:1157 
soundManager: Attempting JS to Flash call... soundmanager2.js:1157 
(Flash): SM2 SWF V2.97a.20121104 (AS3/Flash 9) soundmanager2.js:1157 
Flash security sandbox type: remote soundmanager2.js:1157 
(Flash): JS to/from Flash OK soundmanager2.js:1157 
(Flash): Enabling polling, 10 ms interval soundmanager2.js:1157 
-- SoundManager 2 loaded (OK) -- soundmanager2.js:1155 
soundManager: Firing 1 onready() item soundmanager2.js:1157 
threeSixtyPlayer.init() soundmanager2.js:1157 
threeSixtyPlayer.init(): Found 5 relevant items. soundmanager2.js:1157 
handleClick() soundmanager2.js:1157 
soundManager.createSound(): ui360Sound0 (http://clients.activemd.net/external/x.mp3) soundmanager2.js:1155 
SMSound() merged options: { 
id: ui360Sound0, 
url: http://clients.activemd.net/external/x.mp3, 
onplay: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... }, 
onstop: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... }, 
onpause: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... }, 
onresume: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... }, 
onfinish: { var nextLink; pl.removeClass(this._360data.oUIBox,this._360data... }, 
onbufferchange: { if (this.isBuffering) { pl.addClass(this._360data.oUIBox,pl.css... }, 
whileloading: { if (this.paused) { self.updatePlaying.apply(this); } }... }, 
whileplaying: { self.updatePlaying.apply(this); this._360data.fps++; }... }, 
useWaveformData: 0, 
useEQData: 0, 
usePeakData: 0, 
autoLoad: false, 
autoPlay: false, 
loops: 1, 
multiShot: true, 
multiShotEvents: false, 
pan: 0, 
stream: true, 
usePolicyFile: false, 
volume: 100, 
isMovieStar: false, 
bufferTime: 3 
} soundmanager2.js:1157 
(Flash): SoundManager2_SMSound_AS3: Got duration: 0, autoPlay: false soundmanager2.js:1157 
SMSound.play(): Attempting to load "ui360Sound0" soundmanager2.js:1155 
SMSound.load(): http://clients.activemd.net/external/x.mp3 soundmanager2.js:1155 
SMSound.play(): "ui360Sound0" is starting to play soundmanager2.js:1157 
fanOut: ui360Sound0: http://clients.activemd.net/external/x.mp3 soundmanager2.js:1157 
SMSound._onbufferchange(): 1 soundmanager2.js:1157 
(Flash): start (ui360Sound0): 0 soundmanager2.js:1157 
SMSound._onbufferchange(): 0 soundmanager2.js:1157 
SMSound._onload(): "ui360Sound0" loaded. 

古怪 的鏈接在我的Chrome開發者視圖點擊和MP3在打開單獨的瀏覽器窗口並正常播放(在Chrome中單擊MP3鏈接時默認)

一個可能的理論 聲音正在被加載,但沒有被告知「好吧,繼續,玩自己」。

另一個可能的理論 jQuery是以某種方式與它搞砸。

請幫我確定爲什麼我的聲音加載但沒有播放。

謝謝。 Rick

+0

如果鏈接是可點擊的,但在另一個視圖中打開,請在您的鏈接中添加'type =「audio/mp3」',以便您的瀏覽器識別它的音頻 –

回答

1

我剛剛在自動播放中遇到類似問題。它在Safari中運行良好,但Chrome和FireFox,IE瀏覽器只是追蹤他們正在玩,並沒有發生任何事情。我最終在setTimeout中調用了soundManager.play(id),但我不喜歡我必須這樣做。

我注意到其他開發者使用click()事件來觸發歌曲。我不知道是否有輕微的滯後路由通過點擊事件是它需要讓它播放或不播放,但我試圖將超時設置爲200和500 +毫秒似乎是票。我也認爲,緩衝事件或加載事件可能會在自動播放失敗時觸發播放。在soundManager.createSound(e)之後立即調用soundManager.play(id),在我的結尾完全沒有任何問題。

我添加了一個onbufferchange事件並檢查了playState。如果它不玩,我就讓它玩。這擺脫了setTimeout的需要。