7

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!

Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
Stefan Filip
  • 1,791
  • 3
  • 15
  • 25
  • jwPlayer doesn't work with .PLS files. I just made a pretty thorough search, and it doesn't seem like *any* web players do. You would probably have to look up the stream format and write your own media player, which seems rather infeasible to me. – Allen Z. Dec 11 '11 at 00:29
  • I think this may be a duplicate of http://stackoverflow.com/questions/2743279/how-could-i-play-a-shoutcast-icecast-stream-using-html5 – Dagg Nabbit Dec 11 '11 at 02:05
  • be aware of the limits of HTML5 audio tags: http://html5doctor.com/native-audio-in-the-browser/ and http://caniuse.com/#search=audio – Eonasdan Jul 10 '12 at 19:19

1 Answers1

3

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.

bertobot
  • 116
  • 5
  • Thanks, your suggestion of looking at the contents of the pls file helped me a lot. – Mischa Sep 17 '13 at 13:11
  • If you throw a semi-colon at the end of the shoutcast url then you'll disable the shoutcast browser detection and allow it to work on chrome and firefox. – tim-phillips Mar 04 '14 at 04:57