| The #EXT-X-DISCONTINUITY tag in an HLS (HTTP Live Streaming) playlist is used to indicate a discontinuity between segments, such as when there is a change in encoding parameters, timestamps, or even when switching between different media streams. Example HLS Playlist with #EXT-X-DISCONTINUITY#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:1
# First segment
#EXTINF:10.0,
segment1.ts
#EXTINF:10.0,
segment2.ts
# Discontinuity occurs here (e.g., a switch to a different stream)
#EXT-X-DISCONTINUITY
# New sequence starts (could be a different encoding, timestamp reset, or ad insertion)
#EXTINF:10.0,
segment3.ts
#EXTINF:10.0,
segment4.ts
#EXT-X-ENDLIST
When to Use #EXT-X-DISCONTINUITY ?- When switching between different encoding parameters (e.g., different resolutions or bitrates in the same playlist).
- When inserting advertisements or stitched content that may have different timestamps.
- When there's a gap or jump in the timeline, such as transitioning between different live sources.

|