HTML5 streaming audio

Some used to talk about this around stackoverflow, but didn’t answer anything from what I saw.
I am trying to implement a streaming audio web application. Almost identical to what WFMU did with its player ( http://wfmu.org/html5/player.php ).
All that I managed to figure out from their stream is that they broadcast the stream in PHP, do not know in what format, and then pass it to jPlayer for presentation of HTML5 to the client.
It works great for them, but I'm just not sure how they feed the audio in PHP and what they do in their PHP to present it in an acceptable format for HTML5.
Any ideas are greatly appreciated.
It looks like the PHP script just highlights the sound file ( http://blogfiles.wfmu.org/DG/stream3.php ).

+6
html5 php audio-streaming
source share
1 answer

No need to use PHP. For the customer, all that matters is sending the appropriate type of content and the actual content. In this case, audio / mpeg (MP3) or OGG for Firefox (which now does not work for them, but it definitely can).

I suspect that they use PHP to relay the stream, is that they use SHOUTcast as a streaming server. While doing something, I found this: http://mp3stream.wfmu.org:8000/

Please note that when you click this URL in your browser, you get the main information page. However, if you click this on the music player, you will get a stream. The SHOUTcast server solves this based on the User-Agent string. If it contains "Mozilla" anywhere in the User-Agent, it returns this page. If this is not the case, it returns a stream. So, for the HTML5 audio player, it will use the browser user agent (which contains Mozilla) and will not be able to access the stream. I suspect their PHP script is what concerns the problem.

The PHP script will use cURL, connect to the streaming server with its own User-Agent (maybe anything if it’s not Mozilla), and pass the piece to the browser block that hit the PHP script. A piece of lime key.

+2
source share

All Articles