2020-05-12, 08:33
Hi, sharing some info. I wasn't getting Kodi to play an M3U8 (HLS) playlist that I put in my HDD. The file was named "playlist.m3u8" and looked something like this, with all the segments:
I stored it in a place like "special://temp/myPlaylist.m3u8", and it wouldn't play using either xbmc.Player().play() or xbmcplugin.setResolvedUrl().
But then I found out that using another playlist, a parent playlist that pointed to it, would let Kodi play it. The parent playlist can be stored somewhere like "special://temp/myParentPlaylist.m3u8" and look like this:
You can find the path to Kodi's temp by translating the path with xbmc.translatePath("special://temp/myPlaylist.m3u8"), and then writing that to the parent playlist.
And then you play the parent playlist, not the child.
It's useful to know in case you're trying to do something like this.
Code:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:14
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:9.924600,
https://hostname.com/path/to/segment-000.ts
#EXTINF:5.504400,
https://hostname.com/path/to/segment-001.ts
#EXTINF:4.962300,
https://hostname.com/path/to/segment-002.ts
#EXTINF:1.042500,
https://hostname.com/path/to/segment-003.ts
(...)
But then I found out that using another playlist, a parent playlist that pointed to it, would let Kodi play it. The parent playlist can be stored somewhere like "special://temp/myParentPlaylist.m3u8" and look like this:
Code:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1
C:/path_to_Kodi_temp/myPlaylist.m3u8
And then you play the parent playlist, not the child.
It's useful to know in case you're trying to do something like this.