2012-03-17 57 views
2

在Web瀏覽器中播放流式傳輸aac廣播是否有任何可行的方法? (具體在wii上) 我已經看過flash和VLCJ庫,但沒有運氣。 我知道我去過至少一個網站,通常在瀏覽器中播放它們的流,但我似乎記得它不適用於wii瀏覽器。使用soundmanager2將現有的aac流傳輸到瀏覽器中

感謝

更新: 我發現所謂的聲音管理器2,它聲稱自己是能夠做到這一點有很大的js的工具,但不能得到任何AAC格式的流播放。他們雖然支持。這讓我懷疑我是否配置錯了。

http://www.schillmania.com/projects/soundmanager2/

<html> 
<head><title>Radio Stations</title></head> 
<!-- include SM2 library --> 
<script type="text/javascript" src="soundmanager2.js"></script> 
<!-- configure it for your use --> 
<script type="text/javascript"> 

soundManager.url = 'sm2-flash-files/'; 

soundManager.debugMode = true; 
soundManager.preferFlash = true; 
soundManager.useFlashBlock = true; 
soundManager.flashVersion = 9; 
soundManager.useHighPerformance = true; 
soundManager.useFastPolling = true; 

soundManager.onready(function(){ 

    var bleh = soundManager.createSound({ 
    id: 'NoLife-Radio', 
    url: 'http://radio.nolife-radio.com:8000', 
    type: 'audio/aac', // 'audio/mp4' ? 
    autoPlay: false, 
    stream: true, 
    autoLoad: true 
    }); 
}); 

soundManager.ontimeout(function(){ 

    // Hrmm, SM2 could not start. Flash blocker involved? Show an error, etc.? 
    alert("Could not start"); 
}); 

</script> 


<body> 
<a href="#" onClick="javascript: soundManager.play('NoLife-Radio');">Play</a> 
</body> 
</html> 

回答

0

用於播放流把;在網址的末尾,這將使它發揮作用。 所以替換此: url: 'http://radio.nolife-radio.com:8000',url: 'http://radio.nolife-radio.com:8000;',

關於格式,像Winamp的播放器播放流,並找出哪些是正確的格式。您也可以將soundManager.preferFlash = false;設置爲可以使用HTML5音頻API播放聲音的瀏覽器可以使用它而不是Flash。

相關問題