Reputation: 1801
I would like to play a PLS file (http://live.radioguerrilla.ro:8002/listen.pls) from a website. I would like to use the audio
tag introduced by HTML5 but I don't think it can stream from PLS files. What alternative would your recommend?
Could you also provide a sample code as I tried to play the file with jwPlayer but I wasn't able to get it going. Thanks!
Upvotes: 7
Views: 10873
Reputation: 116
PLS files, themselves, are just metadata. You can write (or find) a parser to get at the real audio source.
The contents of the PLS url you included above contains:
[playlist]
NumberOfEntries=1
File1=http://live.radioguerrilla.ro:8002/
You could then use the url of File1 (or FileN, if more than 1) as your audio source.
<audio source="http://live.radioguerrilla.ro:8002/"> </audio>
...
EDIT:
I was just reading that HTML5 should support streaming, but after a quick research into firefox and chrome, neither explicitly supports shoutcast protocol. Shoutcast protocol is a meta-protocol on top of http. Unlike examples of using with sources as files (mp3, ogg, wav), one can determine the content-type thru the request. With shoutcast, the response payload needs to be processed by something else. The content-type result of any shoutcast stream will return text/plain, and both will throw a message saying so.
Upvotes: 3