video-dev /hls.js
HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
★ 17,053⑂ 2,780👁 303⑃ 4,766● 3,260▤ 335
+0
Daily
17,053
stars
2,780
forks
303
watchers
4,766
prs
3,260
issues
335
releases
README
[comment]: < ([![Sauce Test Status]&40;https://saucelabs.com/browser-matrix/robwalch.svg&41;]&40;https://saucelabs.com/u/robwalch&41;) !HLS.js HLS.js is a JavaScript library that implements an [HTTP Live Streaming] client. It relies on [HTML5 video][] and [MediaSource Extensions][] for playback, and on [Managed Media Source][] where MSE is not available (Safari on iOS 17.1+). It streams VOD, Live, and Low-Latency HLS assets made up of fragmented MP4 (fMP4), MPEG-2 Transport Stream, or Packed Audio segments. fMP4 segments (ISO BMFF, including CMAF) are passed through to MSE without remuxing, while MPEG-2 TS and Packed Audio (AAC, MP3, and AC-3) segments are transmuxed into fMP4. Transmuxing is performed asynchronously using a [Web Worker] when available in the browser. HLS.js streams media into a standard HTML element, which handles decoding, rendering, playback, and seeking. Control playback through the [HTMLMediaElement] API, and use HLS.js to load assets, choose quality levels and tracks, and listen for streaming events. For assets with Interstitials, use hls.interstitialsManager to seek and track position on the integrated timeline of primary content and interstitial breaks. HLS.js is written in [TypeScript] and transpiled using [Babel] to ECMAScript 5 syntax for the UMD bundles, and to native ES module syntax for the ESM bundles. The [TypeScript compiler] and [API Extractor] are used for type checking and to generate the hls.d.ts type declarations. [Rollup] is used to build the distro bundles and, in watch mode, the local development environment. Each release includes: - full and light builds. The light build leaves out optional features such as alternate audio, subtitles, EME (DRM), CMCD, and Interstitials to reduce size (see Build tasks). - UMD bundles (hls.js, hls.light.js) for tags and require. They target browsers as old as Chrome 47, Firefox 51, and Safari 10, and inline the transmuxer worker. - ESM bundles (hls.mjs, hls.light.mjs) for import and modern bundlers. They do not inline the worker; set workerPath to the published hls.worker.js to transmux off the main thread. See Compatibility for supported browsers and runtime requirements. [html5 video]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video [htmlmediaelement]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement [mediasource extensions]: https://w3c.github.io/media-source/ [managed media source]: https://developer.mozilla.org/en-US/docs/Web/API/ManagedMediaSource [http live streaming]: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis [web worker]: https://caniuse.com/search=worker [typescript]: https://www.typescriptlang.org/ [babel]: https://babeljs.io/ [typescript compiler]: https://www.typescriptlang.org/docs/handbook/compiler-options.html [api extractor]: https://api-extractor.com/ [rollup]: https://rollupjs.org/ Features - VOD & Live playlists - DVR support on Live playlists - Low-Latency HLS (Partial Segments
Top issues
#6482Airplay streaming issue on ios16 comments · 2024-06-06#6355Setting `currentLevel` freezes rendering until next keyframe (Chrome)13 comments · 2024-04-15#5881Audio track switching does not apply immediately13 comments · 2023-10-05#3179Stream not playing on Safari but playing perfectly fine on chrome.12 comments · 2020-10-29#3480In mobile browsers, seamlessly switch video (with audio) to audio-only on screen lock/when backgrounded10 comments · 2021-02-13#6294Support delayed create of SourceBuffer9 comments · 2024-03-19#5132Missing audio in first segment9 comments · 2022-12-22#8014LG webOS playback issue with hls.js@latest, works with v1.6.157 comments · 2026-08-27
Discussions
#8129play all ts files1 comments · 2026-10-27#8033hevc.js — an hls.js plugin for HEVC playback on browsers without an HEVC decoder0 comments · 2026-09-08#7694Guidance on PROGRAM-DATE-TIME drift at EXT-X-DISCONTINUITY boundaries1 comments · 2026-01-20#7690Flicker between placeholder and video playing on safari and firefox (chrome is fine)0 comments · 2026-01-13#7678Guidance on handling network-level failures and recovery strategy in hls.js1 comments · 2025-12-18#7644Chrome 142 adds native support for m3u8 streaming.2 comments · 2025-11-14#7584Manifest with multiple codec families0 comments · 2025-10-22#7448Play test bandwidth fragment if the internet is slow2 comments · 2025-08-05
Latest release
v1.7.4 v1.7.4 2026-10-28Summary HLS.js v1.7.4 includes bug fixes and improvements over the last release. Changes Since The Last Release https://github.com/video-dev/hls.js/compare/v1.7.3...v1.7.4 Bug fixes and improvements Low-latency HLS - Fix skipping unloaded trailing parts at fragment boundaries (8055) @darfink - Advance part loading once all parts of a fragment are loaded (8134, follow-up to 8055) @robwalch - Adjust playlist position using first part start PTS (8105, fixes 8098) - Fix repeated audio buffer flushing when setting nextAudioTrack during Low-Latency HLS part loading (8104) - Fix