【问题标题】:Sound Manager 2 stream shoutcast声音管理器 2 流直播
【发布时间】:2015-04-30 10:48:43
【问题描述】:

如何使用 Sound Manager 2 流式传输播音流?我已经找到了很多方法并了解了如何流式传输 mp3 文件,但我无法获得需要提供哪些信息才能使其通过直播播放。

在我的<head> 区域中包含了 js 脚本,到目前为止我的播放代码是这样的:

    <script>
      soundManager.setup({
      url: 'swf/',
      flashVersion: 9, // optional: shiny features (default = 8)
      // optional: ignore Flash where possible, use 100% HTML5 mode
      // preferFlash: false,
      onready: function() {
        // Ready to use; soundManager.createSound() etc. can now be called.
        soundManager.createSound({
            id: 'mySound',
            url: 'playlist.pls',
            autoLoad: true,
            autoPlay: true,
            onload: function() {
                soundManager.play('mySound','playlist.pls');

                alert('The sound '+this.id+' is playing!');
            },
            volume: 50
        });
      }
    });
    </script>

任何帮助将不胜感激:)

【问题讨论】:

    标签: javascript streaming shoutcast soundmanager2


    【解决方案1】:

    我知道这个问题有点老了,但它在 Google 中排名第一。

    您的url 必须直接指向可以从 m3u 或 pls 文件中提取的流式 URL(即,提供媒体文件的 URL,如 mp3)。

    应该是这样的:http://198.15.94.34:8006/stream

    有时在流的最后需要一个分号,例如:http://198.15.94.34:8006/stream;

    【讨论】:

      猜你喜欢
      • 2011-12-08
      • 2012-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多