HTTP Live Streaming (HLS)
HTTP Live Streaming (HLS) is an HTTP-based adaptive streaming technology introduced by Apple in 2009. It’s a video streaming protocol that facilitates the streaming of video content via HTTP. All internet-connected devices support HTTP, making HTTP live streaming one of the most widely-used video streaming protocols. One key benefit of this protocol relates to its compatibility features. Unlike other streaming formats, HLS is compatible with a wide range of devices and firewalls. However, latency (or lag time) tends to be in the 15-30 second range with HLS live streams.
At this point, HLS is a nearly universal protocol. Originally limited to iOS devices like iPhones, iPads, and the iPod Touch, HLS is now supported by the following devices and browsers:
- All Google Chrome browsers
- Safari
- Microsoft Edge
- iOS devices
- Android devices
- Linux devices
- Microsoft devices
- macOS platforms
How does HLS work?
At a high level, HLS works like all adaptive streaming technologies; you create multiple files for distribution to the player, which can adaptively change streams to optimize the playback experience. As an HTTP-based technology, no streaming server is required, so all the switching logic resides on the player.
To distribute to HLS clients, you encode the source into multiple files at different data rates and divide them into short chunks, usually between 5-10 seconds long. These are loaded onto an HTTP server along with a text-based manifest file with a .M3U8 extension that directs the player to additional manifest files for each of the encoded streams.
The player monitors changing bandwidth conditions. If these dictate a stream change, the player checks the original manifest file for the location of additional streams, and then the stream-specific manifest file for the URL of the next chunk of video data. Stream switching is generally seamless to the viewer.