gpt4 book ai didi

javascript - 声音管理器 2 流喊播

转载 作者:行者123 更新时间:2023-12-03 10:41:18 24 4
gpt4 key购买 nike

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

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

    <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>

如有任何帮助,我们将不胜感激:)

最佳答案

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

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

它应该看起来像这样:http://198.15.94.34:8006/stream

有时在流的末尾需要一个分号,如下所示:http://198.15.94.34:8006/stream;

关于javascript - 声音管理器 2 流喊播,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28769905/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com