v1.6.0
Summary
HLS.js v1.6.0 introduces support for HLS Interstitials with new API features, media support, and playback enhancements.
New features in release version 1.6
- HLS Interstitials Support (#6591, #6756, #6852, #6894, #6898, #6900, #6903, #6904, #6905, #6913, #6914, #6915, #6991, #7002, #7014, #7024, #7030, #7049, #7077, #7124, #7131) @robwalch, @matvp91
- Improved support for DolbyVision profiles 8 and 10 with supplemental codecs parsing (#7120, #7095) @timitt, @robwalch
- AES-256 and AES-256-CTR encryption methods (#6018) @jvary
- H.265/HEVC in MPEG2-TS (#5847, #6724, #6194, #6268, #6940) @devoldemar
- CMAF KLV Metadata (set
enableEmsgKLVMetadatatotrueto enable) (#6674) @glynd - Added APIC ID3 parsing via @svta/common-media-library ID3 refactor (#6260) @felipeYoungi
- Support playback of unknown CODECS with browser mime-type support (#6620) @robwalch
- #EXT-X-BITRATE support (#6843)
- CMCD "nor" added (#6091) @littlespex
- Improved stall detection and buffer gap handling (#6941)
- Flush MSE rendering pipeline when crossing video buffer holes with audio (#6972)
- Media Playlist parser validation errors (#7119)
API changes in release version 1.6
- Added
config.detectStallWithCurrentTimeMsused to specify the maximum amount of time in milliseconds before aBUFFER_STALLED_ERRORis reported when the media elementscurrentTimehas not advanced while playing (#6941) - Added
config.nudgeOnVideoHolewhether or not to nudge the playhead when crossing over video buffer gaps to flush the rendering pipeline and ensure smooth playback through video buffered ranges (#6972) - Added
config.enableInterstitialPlaybackset to false to disable Interstitial playback without turning off Interstitials parsing and events - Added
config.interstitialsControllerset tonullto disable Interstitials support completely - Added
config.interstitialAssetListLoadPolicydefines the loading policy of X-ASSET-LIST JSON - Added
config.liveSyncOnStallIncrease(#6455) @vk342 - Added
config.maxDevicePixelRatioto limit browser value when capping level to media element dimensions (#6825) @signalwerk - Added
config.videoPreference.videoCodecvideo codec selection preference option (#6483) - Added config options specifically for Interstitial asset player instances:
config.primarySessionIdidentifies the parent player session that spawned the asset player (read fromhls.sessionId)config.assetPlayerIdidentifies logs from asset playersconfig.timelineOffsetoffsets MSE appends for gapless playback
- Support
config.fetchSetupoptional async result (#6714) @zce - Added
hls.bufferedToEndread-only indicates when EOS has been appended (media is buffered from currentTime to end of stream) - Added
hls.bufferingEnabledread-only flag toggled withpauseBuffering()andresumeBuffering() - Added
hls.hasEnoughToStartgetter returns whether enough is buffered to seek to start position (#6571) - Added
hls.inFlightFragments - Added
hls.interstitialsManagerread-onlyInterstitialsManagerornull. TheInterstitialsManageris an interface for accessing program information and methods for seeking across items and skipping Interstitials. - Added
hls.latestLevelDetailsread-onlyLevelDetailsobject of the most up-to-date HLS variant Playlist data - Added
hls.loadLevelObjread-onlyLevelobject of selected level (variant) ornull - Added
hls.loadingEnabledread-only flag toggled withhls.startLoad()andhls.stopLoad() - Added
hls.pathwayPriorityContent-Steering setting (#6295) @PavelFomin90 - Added
hls.pathwaysgetter (#6997) @grabofus - Added
hls.sessionIdread-onlyHlsinstance UUID - used to assign a value to the _HLS_primary_id query parameter of interstitial requests - Added
hls.startPositionread-only the resolvedstartPositionthat playback will begin at once media is appended - Support setting
hls.targetLatency(#6473) @vk342 - Added
hls.transferMedia()detaches and returns MediaSource and SourceBuffers non-destructively - Added
hls.urlread-only value of the currently playing url (fromhls.loadSource(url)) (#6411) @ibobo - Added
Events.MEDIA_ENDEDevent (#6141) - Added
Events.STALL_RESOLVEDevent (#6941) - Added
Events.EVENT_CUE_ENTERUsed internally to determine when the playhead has entered a time-range replaced by an Interstitial event. - Added
levelInfo: LeveltoLevelLoadingDataandLevelLoadedDataevent data - Added
track: MediaPlaylisttoTrackLoadingDataandTrackLoadedDataevent data (audio and subtitle events) - Added
withoutMultiVariant: booleantoLevelLoadedDataevent - Added
LevelDetais.expiredread-only indicates live playlist data is no longer valid for fragment loading - Added
LevelDetais.requestScheduledto improve live playlist reload scheduling - Added read-only
Fragment.bitrateandFragment.byteLengthgetters - Several
Fragmentproperties have been replaced with accessors:get baseurl(),get/set stats(),get/set programDateTime(). Class property accessors are not enumerable. This impacts copying object properties and serialization.Fragment.statsremain enumerable with (#6999) - Enhancements:
hls.startLoad()takes a second optional argument to skip seeking on start (otherwise, HLS.js seeks following to the first optionalstartPositionargument on append)hls.attachMedia()supports transferring MediaSource and SourceBuffers fromHlsinstances withhls.transferMedia()hls.recoverMediaError()seeks to the value ofcurrentTimebefore the source reset is performed (#6297)
- New Events:
ASSET_LIST_LOADINGwhen a request is made for an X-ASSET-LIST JSON objectASSET_LIST_LOADEDwhen a response is received for an X-ASSET-LIST JSON objectINTERSTITIALS_UPDATEDwhen Interstitials are added, removed, or the schedule is updated following a variant playlist update or updated asset durations from X-ASSET-LIST JSON or asset playlist and media parsingINTERSTITIALS_BUFFERED_TO_BOUNDARYwhen the forward buffer reaches the boundary of the following schedule item (Interstitial event or primary segment)INTERSTITIAL_ASSET_PLAYER_CREATEDwhen an asset player instance is created to stream an Interstitial asset (will always be before attaching media to the asset player)INTERSTITIAL_STARTEDwhen streaming of an Interstitial event containing one or more assets has begun (may occur before X-ASSET-LIST JSON is loaded or playback has started)INTERSTITIAL_ENDEDwhen streaming of an Interstitial event containing one or more assets has ended - before resuming primary or starting the next eventINTERSTITIAL_ASSET_STARTEDwhen streaming of an Interstitial asset has begun (following the beginning of the event or the end of the last asset)INTERSTITIAL_ASSET_ENDEDwhen streaming of an Interstitial asset has ended (before the next asset or the event ending)INTERSTITIAL_ASSET_ERRORwhen an error occurs starting or streaming an Interstitial asset (this can include non-fatal errors such as stalling and errors that will end streaming of the asset, resulting in the schedule advancing to the next asset or fallback to primary)INTERSTITIALS_PRIMARY_RESUMEDwhen playback of primary content has begun or resumed from an Interstitial eventBUFFERED_TO_ENDwhen the last audio and video segments in the playlist have been appended (EOS signaled on all SourceBuffers)AUDIO_TRACK_UPDATEDsimilar to LEVEL_UPDATED fired for any update to audio group playlistsSUBTITLE_TRACK_UPDATEDsimilar to LEVEL_UPDATED fired for any update to subtitle group playlists
- Updated Events
MEDIA_ATTACHING,MEDIA_ATTACHED,MEDIA_DETACHING, andMEDIA_DETACHEDinclude additional information (depending on whether media is being transferred)
- New Errors
- Type:
NETWORK_ERROR- details:
ASSET_LIST_LOAD_ERRORnetwork error loading asset list - details:
ASSET_LIST_LOAD_TIMEOUTnetwork timeout error loading asset list - details:
ASSET_LIST_PARSING_ERRORasset list was not valid JSON or missing required data
- details:
- Type:
OTHER_ERROR- details:
INTERSTITIAL_ASSET_ITEM_ERRORan issue interrupted or prevented asset playback. This will result in skipping the remainder of the asset or falling back to primary content. The eventerrorwill contain more details. This type of error differs from theINTERSTITIAL_ASSET_ERRORevents forwarded from asset player errors. - details:
ATTACH_MEDIA_ERRORwhen callingattachMediawith falseymediaargument (#6556) @agajassi
- details:
- Type:
Enhancements
- Reduce workers across instances (#6550) @robwalch
- Upgrade TypeScript to 5.8 (#7084, #7099)
- Update all type imports to explicitly use the type keyword. (#6332) @cjpillsbury
- Tidy import statements with linter rules (#6378) @robwalch
- Add strict type checking for Uint8Array/ArrayBuffer (#5849) @robwalch
- Log playback rate adjustments. (#7115) @mstyura
- Separate the calculation of the next level into a protected method (#7040) @Kouji-Koike
- Do not close key session on detach (wait until destroy) (#6966) @JackPu
- Make latency-controllers getters safe to call after destroyed (#7015) @robwalch
- Use WebCrypto by default for AES decryption (#6015) @robwalch
- Lazy init CEA608 parsers (#6127) @robwalch
- Use unique logger configurations across instances (#6131, #6198, #6242) @robwalch
- Use average for level sorting and abandon rules check (#6135, #6146) @robwalch
- Handle
ManagedMediaSource"endstreaming" events without aborting requests (#6186) @robwalch - Apply LL-HLS
_HLS_skipparam based on age of last playlist request (#6300) @mcintyrehh - Skip Low-Latency HLS segment and part directives after long delay (#6080) @robwalch
- Switch between LL-HLS part and fragment loading based on playback position (#6170) @robwalch
- Block audio append queue to keep AV appends in lock-step (#6217) @robwalch
- Sync audio fragment loading with main discontinuity and time (#6491) @robwalch
- Unblock audio-only rendition loading (#6862) @robwalch
- Fix audio segment loading when main segments loaded out of sequence (#6537) @robwalch
- Ensure media element references are removed after calling detachMedia (#6249) @robwalch
- DateRange parsing and validation enhancements for Interstitials (#6213) @robwalch
- Program-date-time, date-range, and fragment parsing optimizations (#6811) @robwalch
- Move hash function into utils (#6503) @robwalch
- Remove unused method
remuxEmptyAudio(#6534) @robwalch - Log parsed segment timestamps ahead of append (#6549) @robwalch
- Check-in on abandon rules check and abort in-flight frag when stuck on playlist loading (#6763) @robwalch
- Fragment 4xx network error handling improvements (#6853) @robwalch
- Replace non-null assertions in xhr-loader and gate evoking of loader callbacks (#6942, #6359) @robwalch @ReactWithRajesh
- Exclude AC3 and HEVC remuxing from light build (#6944) @robwalch
Project exports
- Support TypeScript Node16/NodeNext module resolution (#6616) @robwalch
- Add missing TypeScript exports (included with #6951, #6972)
- Export
XhrLoader,FetchLoader,Cues,Events,ErrorTypes,ErrorDetails,Level,SubtitleStreamController,KeySystems,KeySystemFormats,fetchSupported,requestMediaKeySystemAccessES Modules (#6733) @robwalch - Export
M3U8ParserES Modules (#7132) @Acconut - Add shortcut for
lightversion (#6925) @denisx - Force media capabilities check for HEVC to avoid failure on Windows (#6849) @robwalch
Bug Fixes
- Fix seek during live start on low-power devices (#7063) @grabofus
- Live playlist advancement improvements (#6692, #6857, #6872) @robwalch
- Limit live playlist reloading to scheduled updates (#6873) @robwalch
- Live reload throttling per level details schedule (#6879) @robwalch
- Wait for playlist updates before requesting segments from expired playlists (#6855) @robwalch
- Fix fmp4 track timestamp alignment for non-av tracks (#7126)
- Fix loop loading of empty segment with worker disabled (#7090)
- Override media-capabilities result for HEVC support in Windows Firefox (#7048)
- Fix JSON.stringify with circular dependencies (#7037) @martmol
- Fix seeking into and over multiple EXT-X-GAP segments (#6988)
- Workaround Safari "ended" event not firing when EoS is marked before seek on start (#6980) @robwalch
- Null inline class JavaScript Event callback properties on destroy (#6102) @robwalch
- Fix filtering of "mp4a.40.34" variants in Safari (#6130) @robwalch
- Fix silent AAC frame generation based on original codec (#6123) @FredZeng
- Prevent exceptions in async
xhrSetupcallback (#6459) @xta - ADTS to esds remuxing enhancements (#6627) @robwalch
- Fix Safari segment overlap issue by ensuring PTS order (#6132) @Asen-O-Nikolov
- Don't switch level if current already greater or equal (#6223) @corndev27
- fix:
setMediaKeysreturn undefined in some browers (#6669) @JackPu - fix: assumptions in multi-drm cases where only playready is available for playback. (#6946) @cjpillsbury
- fix: tizen 2017 widevine playback (#6657) @grabofus
- Parse multiple pssh from "encrypted" init data and fix Widevine key ID extraction (#6640) @robwalch
- Prevent Widevine access request on "encrypted" w/o configured license url (#6644) @robwalch
- Prevent key errors from being emitted twice (#6704) @robwalch
- bugfix:
setAudioOptionskips track selection at index 0 (#6775) @matvp91 - Fix audio track switch where only characteristics differ (#6963) @robwalch
- Prevent loading of audio media options with the same URI as the current level (#6785) @robwalch
- Handle alternate audio switching and switched states (#6845) @robwalch
- Fix loading of audio media options with the same URI as the current level (#6887) @robwalch
- Fix reset of "ended" state after main muxed audio flush (#6921) @robwalch
- Fix back buffer not being flushed when backBufferLength is set to 0 (#6784) @tmiller02
- fix sidx parsing (#6221) @nklhtv
- Fix audio/subtitles stream controllers restarting on switch after stopped (#6227, #6245) @robwalch
- Cleanup buffer-helper functions and remove nested try-catch statements (#6228) @robwalch
- Bugfix: preferManagedMediaSource:false when MSE is not present (#6338) @Asen-O-Nikolov
- Bugfix: use part details to construct CMCD data when available (#6395) @littlespex
- Fix duplicate subtitle/captions with same NAME edge-case (#6440) @robwalch
- Fix light ESM build (#6307) @Chocobozzz
- Paused and backward seeking enhancements (#6524) @robwalch
- Fix parsing of multiple video codecs when converting from AVC1 to AVCOTI (#6533) @jhonatangcavalcanti
- Improve playlist alignment based on discontinuity sequence change (#6542) @robwalch
- Fix access of media src value with non-source children (#6615) @robwalch
- Do not split AVC samples on Access Unit Delimiter without frame data (#6617) @robwalch
- fix: drop fragment when currentLevel is undefined (#6730) @gjanblaszczyk
- Fix unregister listener typo in audio-stream-controller (#6778) @robwalch
- Bugfix: Low-Latency false starts when part selection does not match fragment (#6841) @robwalch
- Maintain startup event order with
autoStartLoad(#6893) @robwalch - Do not adjust initPTS without accurate playlist time offset (#6922) @robwalch
Documentation
- Document how to find appended sample time offsets (#6658) @fredrikj
- Update iPhone compatibility note with
ManagedMediaSourcesupport (#6202) @Felix212 - Correct design document stream-controller responsibilities (#6367) @neil-liu
- API.md clarify
capLevelToPlayerSize(#6384) @andreashermann - API.md update
removeLevel(#6267) @PavelFomin90 - API.md update CMCD
includeKeys(#6174) @robwalch - API.md update
maxBufferHoledefault (#6578) @robwalch - Add ArtPlayer logo to README (#6864) @zhw2590582
- Add rutube logo to README (#6224) @PavelFomin90
CI
- Update artifact actions (#6099) @tjenkinson
- Update functional tests to run on Safari using MacOS 13 (#6101) @robwalch
- Update dependency update auto merge action and use GitHub auto merge (#6321) @tjenkinson
API and breaking changes
If you are upgrading from version v0.14.17 or lower, see the MIGRATING guide for API changes between v0.14.x and v1.0.0.
If upgrading from version v1.3.x or lower, the introduction of ESM exports may require changes to hls.js import statements and WebWorker setup to achieve comparable performance (#7106 (comment)).
Feedback
Please provide feedback via Issues in GitHub. For more details on how to contribute to HLS.js, see our CONTRIBUTING guide.