yarn hls.js 1.6.0-rc.1
v1.6.0-rc.1

latest releases: 1.7.0, 1.7.0-rc.3.0.canary.11941, 1.7.0-rc.3.0.canary.11939...
17 months ago

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

v1.6.0-beta.4...v1.6.0-rc.1

  • 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 enableEmsgKLVMetadata to true to 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.enableInterstitialPlayback set to false to disable Interstitial playback without turning off Interstitials parsing and events
  • Added config.interstitialsController set to null to disable Interstitials support completely
  • Added config.interstitialAssetListLoadPolicy defines the loading policy of X-ASSET-LIST JSON
  • Added config.liveSyncOnStallIncrease (#6455) @vk342
  • Added config.maxDevicePixelRatio to limit browser value when capping level to media element dimensions (#6825) @signalwerk
  • Added config.videoPreference.videoCodec video codec selection preference option (#6483)
  • Added config options specifically for Interstitial asset player instances:
    • config.primarySessionId identifies the parent player session that spawned the asset player (read from hls.sessionId)
    • config.assetPlayerId identifies logs from asset players
    • config.timelineOffset offsets MSE appends for gapless playback
  • Support config.fetchSetup optional async result (#6714) @zce
  • Added hls.bufferedToEnd read-only indicates when EOS has been appended (media is buffered from currentTime to end of stream)
  • Added hls.bufferingEnabled read-only flag toggled with pauseBuffering() and resumeBuffering()
  • Added hls.hasEnoughToStart getter returns whether enough is buffered to seek to start position (#6571)
  • Added hls.inFlightFragments
  • Added hls.interstitialsManager read-only InterstitialsManager or null. The InterstitialsManager is an interface for accessing program information and methods for seeking across items and skipping Interstitials.
  • Added hls.latestLevelDetails read-only LevelDetails object of the most up-to-date HLS variant Playlist data
  • Added hls.loadLevelObj read-only Level object of selected level (variant) or null
  • Added hls.loadingEnabled read-only flag toggled with hls.startLoad() and hls.stopLoad()
  • Added hls.pathwayPriority Content-Steering setting (#6295) @PavelFomin90
  • Added hls.pathways getter (#6997) @grabofus
  • Added hls.sessionId read-only Hls instance UUID - used to assign a value to the _HLS_primary_id query parameter of interstitial requests
  • Added hls.startPosition read-only the resolved startPosition that 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.url read-only value of the currently playing url (from hls.loadSource(url)) (#6411) @ibobo
  • Added Events.MEDIA_ENDED event (#6141)
  • Added Events.EVENT_CUE_ENTER (for internal use)
  • Added levelInfo: Level to LevelLoadingData and LevelLoadedData event data
  • Added track: MediaPlaylist to TrackLoadingData and TrackLoadedData event data (audio and subtitle events)
  • Added withoutMultiVariant: boolean to LevelLoadedData event
  • Added LevelDetais.expired read-only indicates live playlist data is no longer valid for fragment loading
  • Added LevelDetais.requestScheduled to improve live playlist reload scheduling
  • Added read-only Fragment.bitrate and Fragment.byteLength getters
  • Several Fragment properties 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 optional startPosition argument on append)
    • hls.attachMedia() supports transferring MediaSource and SourceBuffers from Hls instances with hls.transferMedia()
    • hls.recoverMediaError() seeks to the value of currentTime before the source reset is performed (#6297)
  • New Events:
    • ASSET_LIST_LOADING when a request is made for an X-ASSET-LIST JSON object
    • ASSET_LIST_LOADED when a response is received for an X-ASSET-LIST JSON object
    • INTERSTITIALS_UPDATED when 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 parsing
    • INTERSTITIALS_BUFFERED_TO_BOUNDARY when the forward buffer reaches the boundary of the following schedule item (Interstitial event or primary segment)
    • INTERSTITIAL_ASSET_PLAYER_CREATED when an asset player instance is created to stream an Interstitial asset (will always be before attaching media to the asset player)
    • INTERSTITIAL_STARTED when 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_ENDED when streaming of an Interstitial event containing one or more assets has ended - before resuming primary or starting the next event
    • INTERSTITIAL_ASSET_STARTED when streaming of an Interstitial asset has begun (following the beginning of the event or the end of the last asset)
    • INTERSTITIAL_ASSET_ENDED when streaming of an Interstitial asset has ended (before the next asset or the event ending)
    • INTERSTITIAL_ASSET_ERROR when 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_RESUMED when playback of primary content has begun or resumed from an Interstitial event
    • BUFFERED_TO_END when the last audio and video segments in the playlist have been appended (EOS signaled on all SourceBuffers)
    • AUDIO_TRACK_UPDATED similar to LEVEL_UPDATED fired for any update to audio group playlists
    • SUBTITLE_TRACK_UPDATED similar to LEVEL_UPDATED fired for any update to subtitle group playlists
  • Updated Events
    • MEDIA_ATTACHING, MEDIA_ATTACHED, MEDIA_DETACHING, and MEDIA_DETACHED include additional information (depending on whether media is being transferred)
  • New Errors
    • Type: NETWORK_ERROR
      • details: ASSET_LIST_LOAD_ERROR network error loading asset list
      • details: ASSET_LIST_LOAD_TIMEOUT network timeout error loading asset list
      • details: ASSET_LIST_PARSING_ERROR asset list was not valid JSON or missing required data
    • type: OTHER_ERROR details: INTERSTITIAL_ASSET_ITEM_ERROR an issue interrupted or prevented asset playback. This will result in skipping the remainder of the asset or falling back to primary content. The event error will contain more details. This type of error differs from the INTERSTITIAL_ASSET_ERROR events forwarded from asset player errors.

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 InterstitialsSchedule which produces Interstitial events and a schedule of items on level update. The InterstitialsSchedule has
    • an array of InterstitialEvent objects. 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 HLSAssetPlayer instances call the player queue. Each HLSAssetPlayer wraps a child instance of Hls used 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.

Don't miss a new hls.js release

NewReleases is sending notifications on new releases.