Why Apple Created HLS for Safari and HTML5 Video

Apple created the HTTP Live Streaming (HLS) protocol and integrated it directly into the HTML5 video element of the Safari web browser to solve the unique challenges of delivering video to mobile devices. Released in 2009 alongside iOS 3.0, this initiative allowed Apple to eliminate the need for resource-heavy third-party plugins like Adobe Flash, resolve streaming failures over fluctuating cellular networks, reduce server costs by utilizing standard web infrastructure, and maximize device battery life through native hardware acceleration.

Eliminating the Need for Adobe Flash

In the late 2000s, the vast majority of web video relied on Adobe Flash. However, when Apple introduced the iPhone, the company famously refused to support Flash on iOS. Apple argued that Flash was a closed system with significant security vulnerabilities, poor performance on touchscreens, and massive power consumption that rapidly drained mobile batteries.

To provide users with rich web video without relying on proprietary browser plugins, Apple championed the emerging HTML5 standard. By utilizing the native HTML5 <video> element in Safari, web developers could embed video directly into web pages using standard code. However, the standard HTML5 video specification at the time only supported basic progressive downloads, which were insufficient for live broadcasts or long-form content. Apple needed a robust streaming protocol to power this native video element, which led to the creation of HLS.

Solving Mobile Network Instability

Before HLS, streaming relied heavily on protocols like RTSP (Real-Time Streaming Protocol) and Adobe’s RTMP (Real-Time Messaging Protocol). These protocols required a persistent, continuous connection between the server and the user's device. While this worked reasonably well on wired desktop connections, it failed on mobile devices where users constantly moved between Wi-Fi and fluctuating cellular networks. A drop in bandwidth meant the video would freeze or disconnect entirely.

Apple designed HLS to use Adaptive Bitrate (ABR) streaming to fix this problem. Instead of sending a single continuous stream, HLS breaks the video down into small, downloadable file segments—typically a few seconds long—and encodes them at multiple quality levels. Safari reads a master playlist file (an M3U8 manifest) and monitors the device's current network speed. If a user's cellular signal drops, Safari automatically requests the next video segment at a lower resolution, preventing buffering. When the signal improves, it seamlessly switches back to high definition.

Leveraging Standard HTTP Infrastructure

Traditional streaming protocols like RTMP required specialized, expensive streaming servers to maintain persistent connections with every viewer. Furthermore, these protocols operated over specific network ports that were frequently blocked by corporate and public Wi-Fi firewalls, preventing users from watching videos.

Apple built HLS on top of standard HTTP, the same protocol used to load basic web pages and images. Because HLS simply downloads a series of small files over standard web ports, it easily bypasses firewall restrictions. Additionally, it eliminated the need for specialized streaming servers. Content providers could host HLS video segments on ordinary web servers and distribute them globally using existing, cost-effective Content Delivery Networks (CDNs). This made scaling live broadcasts to millions of concurrent viewers significantly easier and cheaper.

Hardware Acceleration and Battery Efficiency

By building HLS support directly into Safari’s HTML5 video element rather than leaving it to third-party JavaScript libraries or plugins, Apple gained complete control over the video playback pipeline.

When a user plays an HLS stream in Safari, the browser hands the decoding process directly to the device's dedicated media hardware chips. Hardware-accelerated decoding requires a fraction of the processing power compared to software-based decoding. This tight integration between the HLS protocol, the Safari browser, the HTML5 standard, and Apple’s silicon ensured that users could watch hours of high-definition video without overheating their devices or draining their batteries.