How to play stream from PLS/M3U playlist

Started by terry_zhou82,

terry_zhou82

I've writen a m3u8 file as follow:
------------------
#EXTM3U
#EXTINF:-1,1 CCTV1
http://vod-stream.nhk.jp/nhkworld/upld/medias/zh/radio/news/20241228130000_chinese_1/index_64k.m3u8
------------------
and I update the file to my server.

But it couldn't play the music  though the BASS.dll, so how can I do??

Ian @ un4seen

That URL in your playlist seems to be dead now, or perhaps it's geo-protected? Are you able to open it in your browser? If so, can you also play it with BASS (and BASSHLS) when it's outside of your playlist, but just not when it's in your playlist?

terry_zhou82

Dear Ian
address is OK! and then ,I Wrote the other pls file like this:
[playlist]
File1=http://www.xxx.net/63.mp3
File2=http://www.xxx.net/64.mp3
Length1=3
NumberOfEntries=2
Version=2

//xxx.net is my server, but it always stops  after play the first mp3?

I want to know why?

Ian @ un4seen

Yes, BASS's playlist support (BASS_CONFIG_NET_PLAYLIST) is only really intended for internet streams, where multiple playlist entries are alternative servers for the same stream. The extra URLs will only be tried if those before it fail to open.

If you would like to play all of the playlist entries, you can implement that yourself: open the first playlist entry and set a BASS_SYNC_END sync on it before playing, and then do the same for the next entry when the sync is triggered, and so on.


Ian @ un4seen

BASS doesn't include support for ASX, but the BASSWMA add-on does add it. Again, it'll only play a single entry, so if you want to play multiple entries then you would need to process ASX yourself too. It's a bit more complicated than M3U/PLS but it's basically an XML file, so you could probably use an XML processing library for it.