HLS format is a streaming media format designed by Apple. That is what we often see, URLs with the suffix ".m3u8". I learned before that some colleagues were unclear about whether a stream is live or on-demand. Here is a way to tell you.
m3u8 itself is a list file. It contains the URLs of TS videos. The player will download the video clips through these URLs and eventually play them smoothly.
As shown below, the contents of an m3u8 file
#EXTM3U
The first line of each M3U file must be this tag.
#EXT-X-TARGETDURATION
Specifies the maximum media duration in seconds. Therefore, the time length specified in #EXTINF must be less than or equal to this maximum value. This tag can only appear once in the entire PlayList file
#EXT-X-MEDIA-SEQUENCE
Each media URI has only a unique sequence number in the PlayList, and the sequence numbers between adjacent ones are +1.
#EXT-X-PLAYLIST-TYPE
Provide information about the variability of PlayList. This is valid for the entire PlayList file and is optional. The format is: #EXT-X-PLAYLIST-TYPE:<EVENT|VOD>: If it is VOD, the server cannot change the PlayList file; if it is EVENT, the server cannot change or delete any part of the PlayList file, but it can add a new line of content to the file.
#EXT-X-ENDLIST
Represents the end of the PlayList. It can appear anywhere in the PlayList, but only one
It's this #EXT-X-ENDLIST. As long as this mark appears in the m3u8 file, it means telling the player: this list is already complete, and there is no need to send a new m3u8 list to the server Request. This means that this is on demand. Because the live broadcast needs to be constantly refreshed to pull in new video clips.