Summary
HLS.js v1.6.0-rc.1 is a feature complete prerelease for preview and testing ahead of the v1.6.0 release.
Changes since the last release
- Supplemental codecs support (#7095) @robwalch
- Fix seek during live start on low-power devices (#7063) @grabofus
- Fix loop loading of empty segment with worker disabled (#7090)
- Fix interstitial playback with media source transfer (#7077)
- Upgrade TypeScript to 5.8 with peer dependencies (#7084)
- TypeScript 5.8 and ESLint cleanup (#7099)
Demo page
https://c0f457c7.hls-js-dev.pages.dev/demo/
New features in release version 1.6
- HLS Interstitials Support (#6591) @robwalch
- Improve support for DolbyVision profiles 8 and 10 (#7095)
- Support playback of unknown CODECS with browser mime-type support (#6620)
- #EXT-X-BITRATE support (#6843)
- AES-256 and AES-256-CTR encryption methods (#6018) @jvary
- H.265/HEVC in MPEG2-TS (#5847) @devoldemar
- CMAF KLV Metadata (set
enableEmsgKLVMetadatatotrueto enable) (#6674) @glynd - CMCD "nor" added (#6091) @littlespex
- Improved stall detection and buffer gap handling (#6941)
API changes in release version 1.6
- Added
config.detectStallWithCurrentTimeMs - Added
config.nudgeOnVideoHole - 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.EVENT_CUE_ENTER(for internal use) - 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. - 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.
- Type:
Design details
The InterstitialsController encapsulates Interstitial functionality. It passes date range data to its scheduler to produce an array of Interstitial events and an array of event and primary items called the schedule. The playback state across this schedule is exposed using hls.interstitialsManager.
InterstitialsController has:
- an
InterstitialsSchedulewhich produces Interstitial events and a schedule of items on level update. TheInterstitialsSchedulehas- an array of
InterstitialEventobjects. Each event contains properties and getters for finding its place on the playback timeline, as well as an array of interstitial assets
- an array of
- an array of
HLSAssetPlayerinstances call the player queue. EachHLSAssetPlayerwraps a child instance ofHlsused to preload and stream Interstitial assets.
The InterstitialsController adds a loader to the corresponding InterstitialEvent while loading asset lists. Once the asset list request is complete, the loader is removed, and the asset list response is added to the InterstitialEvent.
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.