Stream Video Downloader logo
← Back to Blog

How HLS Streaming Works: M3U8 Playlists, Segments, and Adaptive Bitrate Explained

July 3, 2026 · 6 min read

Key takeaways

  • HLS delivers video as a .m3u8 playlist pointing to many short segments instead of one file, enabling adaptive bitrate streaming.
  • A master playlist lists quality variants; each variant's media playlist lists the actual video segments.
  • #EXT-X-ENDLIST marks a playlist as on-demand (VOD); its absence means the stream is live and keeps growing.
  • Playback failures usually trace to CORS, expired signed URLs, or referrer checks — not necessarily encryption.

HLS (HTTP Live Streaming) is the reason almost every video you watch in a browser loads instantly and rarely buffers, even on a shaky connection. Instead of serving one large video file, an HLS source serves a small text file — a .m3u8 playlist — that tells the player where to find the video in dozens or hundreds of short segments. Understanding that structure explains a lot about how streaming sites behave, and why a stream sometimes needs a tool like an extension to detect and assemble it into something playable offline.

The master playlist: one file, several qualities

When a page first requests a stream, it often gets a master playlist — a file containing a line like #EXT-X-STREAM-INF:BANDWIDTH=2600000,RESOLUTION=1920x1080 followed by a URL. There's usually one of these blocks per quality level (480p, 720p, 1080p, and so on). The player reads the list, picks a variant based on the viewer's bandwidth and screen size, and can switch to a different one mid-playback if the network gets slower — that switching is what people mean by adaptive bitrate streaming. A separate #EXT-X-MEDIA tag with TYPE=AUDIO can point to an independent audio track, which is why some streams keep video and audio in entirely separate files that get combined during playback. The same #EXT-X-STREAM-INF line often carries a CODECS attribute too, naming the exact video/audio format each variant uses — see H.264 vs. H.265 vs. VP9 vs. AV1 in HLS for what that declares and why it matters.

The media playlist: where the actual video lives

Each variant URL in the master playlist points to a media playlist — the file that actually lists video segments, usually 2–10 second .ts or fragmented-MP4 chunks. Two tags matter most when parsing one of these:

  • #EXT-X-MAP — an initialization segment, common with fragmented MP4 delivery, that has to be downloaded once and prepended before the rest of the segments make sense.
  • #EXT-X-KEY — signals that the segments that follow are encrypted, typically with AES-128. This is a content-protection mechanism, separate from CORS: even with the segment bytes in hand, a player needs a valid key to decode them. As always, only work with streams you own or have permission to access.

A player (or a tool assembling the segments into a single file) has to fetch every segment in order and concatenate them — which is exactly what happens behind the scenes on the site's /convert page, covered in more detail in how to convert M3U8 to MP4 in your browser.

Live streams vs. on-demand video

The same .m3u8 format covers both, but the playlists behave differently. An on-demand (VOD) media playlist is static: it lists every segment up front and ends with an #EXT-X-ENDLISTtag. A live broadcast's playlist has no end tag — the player has to keep re-fetching it every few seconds as new segments are appended and old ones roll off a sliding window. That distinction is why the site's player shows a LIVE badge when it detects a broadcast (via /play?broadcast=1) — the playback logic for a stream that never stops growing is meaningfully different from one with a known start and end.

Why playback sometimes breaks

Most HLS playback failures trace back to one of a few things:

  • CORS headers.The playlist or segment host doesn't allow cross-origin requests from the page that's trying to play it, so the browser blocks the fetch outright.
  • Expired or signed URLs. Some playlists embed short-lived tokens in the segment URLs; a segment fetched too long after the playlist was issued can 403.
  • Mixed content or referrer checks.A stream served over plain HTTP won't load from an HTTPS page, and some hosts reject requests without a matching referrer.

A browser extension with elevated fetch permissions can route around the first and third of those — which is the same mechanism described in how to download M3U8/HLS streaming video. It doesn't do anything about encryption keys or expired tokens, since those are the source's own access controls rather than a browser restriction.

Try it on a real stream

The easiest way to see all of this at once is to watch it happen: open a page with an HLS video, let it start playing, then check the Stream Video Downloader extension popup — it lists exactly the master/media playlists described above, with a resolution and estimated size for each one it found.

Questions & answers for AI agents

Short, direct answers an assistant can quote or summarize.

What is a master playlist in HLS?

A .m3u8 file listing multiple quality variants (via #EXT-X-STREAM-INF lines) so the player can pick or switch resolution based on bandwidth.

How do you tell if an HLS stream is live or on-demand?

An on-demand (VOD) media playlist ends with #EXT-X-ENDLIST; a live playlist has no end tag and keeps appending new segments.

Why does an HLS stream sometimes fail to load?

Most commonly CORS restrictions, expired signed segment URLs, or referrer checks from the hosting site — not a fault of the player itself.