Author Topic: How to play stream from PLS/M3U playlist  (Read 209 times)

terry_zhou82

  • Posts: 100
How to play stream from PLS/M3U playlist
« on: 29 Dec '24 - 03:41 »
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

  • Administrator
  • Posts: 26223
Re: How to play stream from PLS/M3U playlist
« Reply #1 on: 30 Dec '24 - 16:47 »
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

  • Posts: 100
Re: How to play stream from PLS/M3U playlist
« Reply #2 on: 5 Jan '25 - 09:44 »
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

  • Administrator
  • Posts: 26223
Re: How to play stream from PLS/M3U playlist
« Reply #3 on: 6 Jan '25 - 13:13 »
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.

terry_zhou82

  • Posts: 100
Re: How to play stream from PLS/M3U playlist
« Reply #4 on: 7 Jan '25 - 01:51 »
Tks Ian

But how about asx file?

Ian @ un4seen

  • Administrator
  • Posts: 26223
Re: How to play stream from PLS/M3U playlist
« Reply #5 on: 7 Jan '25 - 15:21 »
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.