Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I play a PLS file from a website?

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!

like image 666
Stefan Filip Avatar asked Dec 11 '11 00:12

Stefan Filip


People also ask

How do I play a PLS file?

How to Open a PLS File. Audio Playlist files with the . PLS file extension can be opened with iTunes, Winamp Media Player, VLC, PotPlayer, Helium, Clementine, CyberLink PowerDVD, AudioStation, and other media management software programs. You can also open PLS files in Windows Media Player with Open PLS in WMP.

How do I play a PLS file in VLC?

Run VLC. Click on Media on menu bar, choose Open File and import PLS files.


1 Answers

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.

like image 186
bertobot Avatar answered Sep 30 '22 23:09

bertobot