HLS.js is a JavaScript library that plays HTTP Live Streaming video in browsers using MediaSource Extensions.
The library solves the problem of delivering HLS streams to web browsers that lack native HLS support by implementing an HTTP Live Streaming client on top of standard HTML5 video elements. It works by transmuxing MPEG-2 Transport Stream and AAC/MP3 audio into ISO BMFF (MP4) fragments, with transmuxing performed asynchronously using Web Workers when available. The tool supports both traditional HLS and HLS with fmp4 containers, allowing it to handle a range of streaming formats.
Developers should choose this library when building web video players that need to support HLS streams across browsers without relying on native playback support. It suits projects requiring reliable cross-browser streaming where you control the player implementation and want to work directly with standard HTML5 video elements. The library is written in TypeScript and ECMAScript6, transpiled to ECMAScript5 for broader compatibility, and uses Rollup for bundling and local development.
The project maintains active development with regular updates addressing streaming edge cases and browser compatibility. The codebase shows consistent attention to performance optimization, particularly around the asynchronous transmuxing pipeline. The tool demonstrates ongoing investment in supporting evolving HLS specifications and maintaining compatibility across different browser implementations of MediaSource Extensions.