0

I have an m3u8 video that if I just start with the first segment it is behind the live version of the stream. But in some players it plays live just fine, so my thinking is that there must be some magical way of knowing how to play the stream live but I don't see anything on the manifest telling me this.

So what should I be looking for?

Thank you.

casolorz
  • 8,486
  • 19
  • 93
  • 200
  • 1
    Read the pantos spec. It’s all in there. – szatmary Oct 23 '17 at 17:31
  • Thanks for that info. I've read the whole thing and still didn't find anything I could use to do what I want to do. `EXT-X-START` seems to be the closest but my m3u8 files don't have that. I also don't seem to get a `EXT-X-PROGRAM-DATE-TIME`. The only thing that was semi close was `If the EXT-X-ENDLIST tag is not present and the client intends to play the media normally, the client SHOULD NOT choose a segment which starts less than three target durations from the end of the Playlist file.` but that doesn't tell me how to play it live, just what I shouldn't do. – casolorz Oct 23 '17 at 19:31
  • @casolorz The last segment in the playlist is the more recent. If you start within less than three target durations you risk stalling the playback. You're *always* behind the live event by at least the duration of the last segment. What're you trying to do exactly? – aergistal Oct 24 '17 at 14:22
  • @aergistal I have a stream that if I play with the first segment it is about 3 hours behind. The user wants to play it close to live. So if I'm understanding right, I would start on the 3rd segment from last and that would be live? Thanks. – casolorz Oct 24 '17 at 15:13
  • @casolorz no, not 3 segments. 3 target durations. Target duration is the max duration. Segments can be shorter. – aergistal Oct 24 '17 at 16:25
  • Ohh, good point, thank you for that correction. I have done some preliminary testing and this seems to work. If you want to write it as an answer I will gladly mark it correct. – casolorz Oct 24 '17 at 16:26
  • @aergistal one more question. My users have two types of videos, infinite live m3u8 and and finite m3u8 videos. If I go to the last 3 target durations on the finite ones then it will only play a few seconds and then end which won't be good. I noticed other video players are able to distinguish between those two types. I'm guessing because of the `#EXT-X-ENDLIST` tag at the end of the m3u8. Is that the correct way to determine this? Thanks. – casolorz Oct 29 '17 at 21:22
  • @casolorz There are three playlist types: **Live** - sliding window / fixed number of segments, **VOD** - all segments + ENDLIST, **Event** - records all segments of a live event and once it's over adds the ENDLIST transforming it in a VOD playlist. For Live/on-going Event you should play the most recent, while for VOD/finished Event you should start with the first. – aergistal Oct 30 '17 at 08:40
  • @aergistal thank you, that is very helpful. How can I detect the type prior to playing the video? – casolorz Oct 30 '17 at 15:11
  • @casolorz `EXT-X-PLAYLIST-TYPE` if present. Check the standard. – aergistal Oct 30 '17 at 17:36
  • Yeah I saw that on the spec but I've never actually seen it on any of the videos I'm looking at. The only differentiator I have found so far is `#EXT-X-ENDLIST` – casolorz Oct 30 '17 at 17:58

0 Answers0