2

有没有可行的方法在网络浏览器中播放流式 aac 广播?(特别是在 wii 上)我已经研究了 flash 和 VLCJ 库,但没有运气。我知道我至少去过一个通常从浏览器内播放他们的流的网站,但我似乎记得它在 wii 浏览器上不起作用。

谢谢

更新:我发现了一个很棒的 js 工具,叫做声音管理器 2,它声称能够做到这一点,但无法播放任何 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>
4

1 回答 1

0

用于播放流放在网址的末尾,这将使其播放。所以替换这个: url: 'http://radio.nolife-radio.com:8000', 用这个url: 'http://radio.nolife-radio.com:8000;',

关于格式,在 Winamp 之类的播放器中播放流并找出正确的格式。此外,您可能想要放置soundManager.preferFlash = false;以便可以使用 HTML5 音频 api 播放声音的浏览器可以使用它而不是 flash。

于 2012-09-08T11:04:46.170 回答