Issue to play real audio streaming (.m3u & .pls)
Hi,
Currently, it seems that createAudioPlayer function can't read m3u and pls files.
I've test with mp3 files and it work fine, but with pls files like this: http://fg.impek.tv/listen.pls it doesn't work. In my case, this pls file is composed of :
[playlist]
NumberOfEntries=1
File1=http://fg.impek.tv:80/
I think the function doesn't support this kinds of reading. So is there any alternative or solution to make this working ?
Thanks for all replies.
3 Answers
-
You will have to write your own little parser and then use the data from the generated array as you normally would. Here's a resource with a simple example that should help you solve this using regular expressions.
-
Had to any luck resolving this. I'm stuck as well with a m3u file. I don't really get how to implement the parser either.
Thanks.
-
To parse:
- Get the contents of the playlist file via an HTTPClient request
- Create an array by splitting the string by line breaks
- Get the last element in the array and split that string by the equal sign.
.. that should be enough to get the stream url, among other things you might want.
It all boils down to very simple string manipulation using JavaScript ;)
Just think it through, step by step, until you get the data you want.