Closed dannyseismic closed 1 year ago
Hi @dannyseismic,
The URL is not relevant in this case. What matters is that segments have contiguous media samples and timestamps. For an HLS player to play through segments that are not contiguous (e.g. not ordered segments of the same mp4 or transport stream) they need to marked in the playlist with a #EXT-X-DISCONTINUITY tag:
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:11
#EXTINF:10.416666,no-desc
https://media.somewhere.com/video1/QualityLevels(123)/Fragments(video=0,format=m3u8-aapl)
#EXT-X-DISCONTINUITY
#EXTINF:10.427083,no-desc
https://media.somewhere.com/video2/QualityLevels(123)/Fragments(video=0,format=m3u8-aapl)
#EXT-X-ENDLIST
Any time you insert segments in a playlist that were not segmented that way, you must signal a discontinuity with this tag. If you are dealing with fmp4 segments than you also need to be careful to include the initialization segments as well (EXT-X-MAP).
What do you want to do with Hls.js?
I don't know if this is a bug, or if there's some critical piece of metadata I'm missing...
I want to assemble a playlist of various HLS fragments. This seems to work as long as the fragments are put together in increasing
video=xyz
order, but it seems to fail if that order ever stays the same or decreases.This fails to load the second video (2 different videos
video1
andvideo2
starting with the same offset)Both videos segments play fine as long as they are the only one in the file.
This works (Same
video1
, butvideo2
has a higher fragment number)What have you tried so far?
I tried looking to see if there is some sort of additional metadata I need to put to change the base URL (and I don't see anything). I tried putting the videos in the m3u8 file in different orders to see what would happen.
I am using
hls.js
through react-player, but I also triedhttps://hls-js.netlify.app/demo
player with the same results.When the initial file loads, the correct number of total seconds for the video flashes on the status bar, but then it seems to discount the 2nd file in the list and changes the total number of seconds.