為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Playing mp3 Shoutcast streams with HTML5 audio in Firefox?

  • 1 回覆
  • 21 有這個問題
  • 1 次檢視
  • 最近回覆由 biggyspender

more options

I'm trying to play mp3 shoutcast stream radio stations with HTML5 audio.

I don't think it will be relevant but here is the code anyway:

var player = new Audio(); player.autobuffer = true; player.src = "http://173.192.48.71:9048/;"; player.volume = 1; player.play();

Shoutcast detects that request comes from browser and returns radio status page, so I put ";" at the end of stream which forces server to return audio stream instead of status page. This works fine in Chrome and Safari, but not in Firefox.

Firefox for some reason detects this as text/plain content and refuses to play it with this error:

HTTP "Content-Type" of "text/plain" is not supported. Load of media resource http://173.192.48.71:9048/; failed.

But work in firefox 19. Oh God, what am I gonna do?

I'm trying to play mp3 shoutcast stream radio stations with HTML5 audio. I don't think it will be relevant but here is the code anyway: var player = new Audio(); player.autobuffer = true; player.src = "http://173.192.48.71:9048/;"; player.volume = 1; player.play(); Shoutcast detects that request comes from browser and returns radio status page, so I put ";" at the end of stream which forces server to return audio stream instead of status page. This works fine in Chrome and Safari, but not in Firefox. Firefox for some reason detects this as text/plain content and refuses to play it with this error: HTTP "Content-Type" of "text/plain" is not supported. Load of media resource http://173.192.48.71:9048/; failed. But work in firefox 19. Oh God, what am I gonna do?

所有回覆 (1)

more options

So I downloaded the Mozilla code and fixed this issue. It looks like it will find its way into mozilla24.

由 biggyspender 於 修改