Is it possible to play shoutcast (or some) internet radio streams with html5?
So I have next code:
You can't do it with ShoutCast but with Icecast and edcast client you can stream live vorbis trough HTML5 <audio>
tag. Just point it to http://your-url.com:port/stream.ogg :p
well I've checked ogg_vorbis stations. I downloaded some playlist and opened it in notepad, and copy out the url of a stream. So if you want to test it just copy this to empty file and name it something.html.
<!DOCTYPE html>
<html>
<head>
<title>audio testing live stream!</title>
</head>
<body>
<audio controls="controls" autoplay="autoplay" src="http://oggvorbis.tb-stream.net:80/technobase.ogg">
</audio>
</body>
</html>
that's it!
BB
<!DOCTYPE html>
<audio controls src="http://baldyradio.com:8010/;"></audio>
This works in the release version of IE9, Sad that the same can not be said for FireFox 4!
HTML5 doesn't specify what audio formats (whether progressive or streaming) the player must support. That's up for the browser to determine, based on demand and implementation feasibility. In earlier drafts, we tried to specify a few baseline codecs and formats that all browsers must support, but each of the possible formats caused some browser vendor to refuse to implement it.
The following appears to work in Safari (4.0.4, WebKit nightly 6531.21.10, r54538, Mac OS X 10.6.2), but not Chrome or Firefox:
<!DOCTYPE html>
<audio controls src="http://shoutcast.internet-radio.org.uk:10272/"></audio>
(note that <audio>
requires an end tag in the HTML serialization, it can't use an XML style self-closing tag, and I need to include controls
or autoplay
in order to actually start the audio)
This is likely due to the fact that Safari gets support for Shoutcast "for free" because it just uses QuickTime to handle any audio and video URLs it is given, and QuickTime already has support for Shoutcast. This can also lead to some strange bugs, as QuickTime's HTTP implementation is, well, quirky, to put it kindly.
I'd suggest filing bugs asking for Shoutcast support in browsers that don't support it. Here are the bug trackers for Firefox (Gecko/Mozilla), Chrome (Chromium), and Safari (if it happens not to work on Windows, or something like that).