How HLS works
The video is encoded at several quality levels and each is cut into segments, typically two to six seconds long. A multivariant playlist lists the available qualities; a media playlist for each quality lists its segments in order.
The player downloads the multivariant playlist, picks a quality, and fetches segments one after another, switching quality as the connection changes. For a live stream the media playlist is updated continually as new segments are produced.
Why HLS is so widely used
- It is native on every Apple device and supported on Android, smart TVs and, through JavaScript players, every modern browser
- It uses plain HTTP, so any web server and CDN can deliver and cache it
- It supports adaptive bitrate, subtitles, multiple audio tracks and ad markers
- It supports encryption and FairPlay DRM
HLS latency
Because the player buffers several segments before starting, standard HLS runs roughly 10 to 30 seconds behind live. Low-Latency HLS divides segments into smaller parts and brings the delay down to a few seconds, at the cost of more demanding delivery.
HLS vs MPEG-DASH
DASH is an international standard that works in a very similar way and is common on Android and smart TVs. Apple devices do not play it natively. With the CMAF format, one set of video segments can be referenced by both an HLS playlist and a DASH manifest, so a service can support both without storing the video twice.
Last reviewed