Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How could I play a shoutcast/icecast stream using HTML5?

Is it possible to play a shoutcast/icecast stream using HTML5?

If so, how should I implement it?

like image 873
Cy. Avatar asked Apr 30 '10 08:04

Cy.


People also ask

How do you play Icecast streams?

Just navigate your web browser to host/port the Icecast server is listening on. If you are a Windows user, make sure you started the Icecast server and then click on the shortcut in the Startmenu, it will open the Icecast status page in your browser.

How do I listen to Shoutcast streaming?

Go to the Media Library tab, select Online Services, and choose SHOUTcastRadio. Choose a radio station from the SHOUTcast Radio progressive menus or search for a specific station. To listen to a station, click Tune IN. Bookmark the stations you like so that you don't have to search for them again.

Can VLC stream to Icecast?

To stream audio or video to Icecast using VLC you need to first ensure you have the right module installed. If you are using Linux you will need to download the latest source code and install VLC with the shout module. To install this module in Linux you will need to configure VLC with the --enable--shout parameter.

Can Icecast stream video?

Configuring Icecast To be able to stream video, we need to adapt the config a little bit, so that the Icecast buffer for our video stream will be large enough to hold enough data. This can be done either globally for all mountpoints, which is appropriate if you only plan to stream video with this Icecast instance.


1 Answers

2020 update

Modern browsers don't need any special treatment or server-side workarounds to play audio. Simply use an audio tag with a direct link to one or more stream sources (not a playlist):

<audio>     <source src="http://relay.publicdomainradio.org/classical.mp3" type="audio/mpeg"> </audio> 

From MDN:

The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one.

Browsers support flac, mp3, vorbis, aac, opus and wav. More details on caniuse.com.

Original post

Add a semicolon to the end of the http request. It IS the protocol set forth by shoutcast to override it's browser detection. Like this:

<audio controls src="http://shoutcast.internet-radio.org.uk:10272/;"></audio> 
like image 86
Nate Sweet Avatar answered Sep 28 '22 15:09

Nate Sweet