【问题标题】:icecast stream html5 player audio tagicecast 流 html5 播放器音频标签
【发布时间】:2019-03-11 10:39:58
【问题描述】:

我在获取嵌入此音频标签的流时遇到问题:

<audio controls autoplay="autoplay"><source src="http://159.65.84.223:8000/stream?type=.mp3" type="audio/mp3">Your browser does not support the audio element.</audio>

我应该使用其他代码吗?

谢谢

【问题讨论】:

  • 该 URL 未指向现有流。所以这显然行不通。

标签: html stream mp3 icecast m3u


【解决方案1】:

您可以在XSPF file of your stream 中找到正确的音频链接(以文本文件形式打开)。

尝试设置代码为:

<audio controls autoplay="true">
<source src="http://mensajito.mx:8000/00a48ebe728b" type="audio/mp3">
</audio>

测试下面的示例链接,并报告它是否给出了正确的(播放)结果:

https://jsfiddle.net/5s69pb34/

一些注意事项:

  • 您的流链接是http://,如果在某些https:// 网站中使用,可能无法正常工作。

  • type 可以是 "audio/mp3""audio/mpeg"。如果出现错误,请尝试每种类型。

【讨论】:

  • 请注意无法停止或暂停通过 html 5 音频的流。暂停时,流音频停止,但文件下载在后台继续。这暂停了 2 个问题,1)即使用户认为他们停止或暂停了流,用户的电话数据仍然被吃掉。 2)当用户恢复时,从他们离开的地方播放恢复。
猜你喜欢
  • 1970-01-01
  • 2019-02-09
  • 2016-11-19
  • 2017-04-12
  • 1970-01-01
  • 2014-11-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多