Determining HLS stream content type

2.9k views Asked by At

I have written a simple parser for parsing Media Playlist file (m3u8) (HLS stream)

"EXT-X-PLAYLIST-TYPE" tag is used to determine the type of content i.e. whether the content is VOD (can't change) or EVENT (can change).

My problem is that "EXT-X-PLAYLIST-TYPE" is an optional tag. If EXT-X-PLAYLIST-TYPE tag is not present in the Media Playlist file, is there a way I can determine the content type?

Currently I check for "EXT-X-ENDLIST" which indicates that no more Media Segments will be added to the Media Playlist file. Is this approach check correct?

2

There are 2 answers

0
Vishvesh On BEST ANSWER

Okay, I think it should be fine, According to the player playlist specification:

https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-14#page-29

If the Media Playlist contains the final Media Segment of the presentation then the Playlist file MUST contain the EXT-X-ENDLIST tag; this allows clients to minimize unproductive Playlist reloads.

If a Media Playlist does not contain the EXT-X-ENDLIST tag, the server MUST make a new version of the Playlist file available that contains at least one new Media Segment. It MUST be made available relative to the time that the previous version of the Playlist file was made available: no earlier than one-half the target duration after that time, and no later than 1.5 times the target duration after that time. This allows clients to utilize the network efficiently.

0
Ham On

In RFC8216, Live playlist MUST NOT contain EXT-X-PLAYLIST-TYPE tag because :

  • all the valid values of the tag (VOD,EVENT) indicate that playlist must NOT be changed during playback
  • Live stream (not VOD) allows server implementations to limit number of available media segment at any time point (e.g. by removing segments already served at the beginning)

That is one of the reasons why EXT-X-PLAYLIST-TYPE tag is optional.