Understand the basic composition for a Video on Demand playlist.
For Video on Demand (VOD) sessions, media files are available representing the entire duration of the presentation. The index file is static and contains a complete list of URLs to all media files created since the beginning of the presentation. This kind of session allows the client full access to the entire program.
This code is an example of a Video on Demand playlist:
These are the tags used in the Video on Demand playlist example:
EXTM3U: Indicates that the playlist is an extended M3U file. This type of file is distinguished from a basic
M3U file by changing the tag on the first line to
EXTM3U. All HLS playlists must start with this tag.
EXT-X-PLAYLIST-TYPE: Provides mutability information that applies to the entire playlist file. This tag may contain a value of either
VOD. If the tag is present and has a value of
EVENT, the server must not change or delete any part of the playlist file (although it may append lines to it). If the tag is present and has a value of
VOD, the playlist file must not change.
EXT-X-TARGETDURATION: Specifies the maximum media-file duration.
EXT-X-VERSION: Indicates the compatibility version of the playlist file. The playlist media and its server must comply with all provisions of the most recent version of the IETF Internet-Draft of the HTTP Live Streaming specification that defines that protocol version.
EXT-X-MEDIA-SEQUENCE: Indicates the sequence number of the first URL that appears in a playlist file. Each media file URL in a playlist has a unique integer sequence number. The sequence number of a URL is higher by 1 than the sequence number of the URL that preceded it. The media sequence numbers have no relation to the names of the files.
EXTINF: A record marker that describes the media file identified by the URL that follows it. Each media file URL must be preceded by an
EXTINF tag. This tag contains a duration attribute that's an integer or floating-point number in decimal positional notation that specifies the duration of the media segment in seconds. This value must be less than or equal to the target duration.
EXT-X-ENDLIST: Indicates that no more media files will be added to the playlist file.
The VOD playlist example above uses full pathnames for the media file playlist entries. While this is allowed, using relative pathnames is preferable. Relative pathnames are more portable than absolute pathnames and are relative to the URL of the playlist file. Using full pathnames for the individual playlist entries often results in more text than using relative pathnames. Here's the same playlist with relative pathnames: