What is the playlist type in HLS?
In HLS (HTTP Live Streaming), the EXT-X-PLAYLIST-TYPE tag is used to declare the type of the playlist file. This tag has two possible values: VOD (Video On Demand) and EVENT.
VOD: This specifies that the playlist file is a Media Playlist file of a completed presentation, i.e., the entire presentation is encoded and available. When the playlist type is VOD, clients can assume that no more media segments will be added to the Media Playlist file. This allows the client to make optimizations, such as pre-loading the entire playlist without worrying about changes.
EVENT: This specifies that the Media Playlist file is an ongoing (live) presentation. In this case, segments may only be appended to the Media Playlist file and it won't have an end-list tag until the broadcaster ends the stream. Clients that load an EVENT playlist cannot assume that it will remain unchanged between reloads, but they can append new segments to the old ones.
In absence of the EXT-X-PLAYLIST-TYPE tag, the playlist is assumed to be a live playlist where segments can be removed and/or added at any time.
The EXT-X-PLAYLIST-TYPE tag provides valuable information to the player about the nature of the stream, enabling it to handle the stream appropriately and make optimizations based on the type of the playlist.
The EXT-X-PLAYLIST-TYPE tag in HLS (HTTP Live Streaming), specifically when set to EVENT, can facilitate features such as start-over and rewind in live streaming scenarios.
When the EXT-X-PLAYLIST-TYPE is set to EVENT, the Media Playlist file represents an ongoing presentation or a live stream. In this mode, segments are appended to the playlist over time, but unlike in the default "live" mode, segments are not removed from the playlist. This means that clients can request any segment from the playlist at any time, enabling features like start-over and rewind.
Start-over and rewind are features that allow viewers to go back to the beginning of the program (start-over) or to a specific point in the past (rewind), even in a live stream.
Start-over: This feature allows viewers to go back to the start of the program, even if they joined the stream late. Since the EVENT playlist retains all segments from the start of the program, clients can request the initial segments again to implement a start-over.
Rewind: This feature allows viewers to go back to any point in the program that has already been broadcast. Similar to the start-over feature, this is possible because the EVENT playlist retains all segments. Clients can request any segment from the past to implement a rewind.
These features require additional resources on the server side, as it needs to retain all segments for the duration of the stream. Also, the client players need to be capable of handling such operations. Therefore, these features are not universally available in all streaming scenarios.