Commit Graph
394 Commits
Author SHA1 Message Date
Rob WalchandGitHub b9f85e9c78 Fix seeking into and over multiple EXT-X-GAP segments (#6988)
* Fix seeking into and over multiple EXT-X-GAP segments
Fixes #6814

* Add `hls.loadLevelObj` to API - replaces internal use of `hls.levels[hls.loadLevel]`
2025-02-03 17:27:09 -08:00
Rob WalchandGitHub 305a3a7477 Flush MSE rendering pipeline when crossing video buffer holes with audio (#6972)
* Flush MSE rendering pipeline when crossing video buffer holes with audio
Resolves #5631
* Don't wait to nudge when stalling with waiting event
Fixes #6169
* Add `hls.inFlightFragments` to Hls API. Used to determine if gap-controller should wait for in-flight media segments before seeking over gaps.
2025-01-31 16:23:13 -08:00
蒲小花andGitHub 4e190d5165 feat: split the _close method from mediaDetach (#6966)
Authored-by: Huan Pu <huanpu@tubi.tv>
2025-01-31 14:17:40 -08:00
Rob WalchandRob Walch d672e73ef1 Fix delta updates with discontinuity tags
Fixes #6949
2025-01-14 11:36:34 -08:00
Rob WalchandRob Walch 881170e204 Gap controller fixes
- Improve stall detection and reporting using "waiting" event timing
- Add `config.detectStallWithCurrentTimeMs` with a default of 1250 to configure stall detection when currentTime does not advance while playing without a "waiting" event
- Implement STALL_RESOLVED event - fires after "playing", "seeked", or "ended" event following BUFFER_STALLED_ERROR (Resolves #4273)
- Add BufferInfo to stall-related errors (BUFFER_STALLED_ERROR, BUFFER_NUDGE_ON_STALL, BUFFER_SEEK_OVER_HOLE)
- Add `stalled.start` performance timing to BUFFER_STALLED_ERROR
- Add `buffered` time range array to BufferInfo
- Only perform BUFFER_NUDGE_ON_STALL when needed (multiple buffered time ranges)
- Fix seek on start without play() request (regression in dev)
2025-01-13 15:22:54 -08:00
Christian PillsburyandGitHub d602e36b25 Fix assumptions in Multi-DRM cases where only PlayReady is available for playback (#6946)
* fix: assumptions in multi-drm cases where only playready is available for playback.
* Only use selected key-system in EME "encrypted" media event handler
Resolves #6947 / Suggested changes for #6946
* chore: Refactors to improve logging in DRM mismatch cases.
* chore: More updates to improve logging in DRM mismatch cases.
* chore: Use a warn for unexpected psshInfos head count for key system
2025-01-10 10:51:03 -08:00
Rob Walch 17a49cf137 Make mergeDetails a no-op when both arguments are the same object
Fix buffer flushing when switching between audio-only from main and alt (variant and media playlists)
Add additional test coverage
2024-12-20 16:36:12 -08:00
Rob WalchandRob Walch 523402db94 Fix stream ended check in interstitial asset players sharing a media-source timeline 2024-12-13 16:24:19 -08:00
Rob WalchandGitHub b3be549eb7 Live reload throttling per level details schedule (#6879)
Live reload throttling per level details schedule
- Improve blocking requests with parts and low-latency mode disabled
- Defer autostart until after manifest loasded and level loaded when media playlist is source
Fixes #6858

Interstitial startup fixes
- Added `hls.loadingEnabled` getter
- Do not call startLoad when stopped and do not resume primary on first item
Fixes #6839

Break start/stop load function synchronously if loading state was changed or instance destroyed
- Fix segment loading edge cases following `removeLevel(<currentLevelIndex>)`
Addresses functional test failure: https://github.com/video-dev/hls.js/actions/runs/12124731664/job/33809171310?pr=6879
2024-12-02 16:22:32 -08:00
Rob WalchandGitHub 550dc2af17 Limit live playlist reloading to scheduled updates (#6873)
Fixes #6858
2024-11-28 17:23:12 -08:00
Rob WalchandGitHub 6e0656ac71 Fix regressions in live playlist advancement (from #6692 and follow-up #6857) (#6872) 2024-11-28 13:43:43 -08:00
Rob WalchandGitHub ac4be62dce Re-align audio playlist with main when there is no overlap between audio playlist updates (#6857)
* Attempt to realign audio with main when `alignPlaylists` finds no overlap in playlist updates
#6823
* Cache audio playlist responses until main playlist is alignable
* Align on starting discontinuity tag with discontinuity-sequence (startCC is discontinuity-sequence)
2024-11-22 14:06:45 -08:00
Rob WalchandGitHub 7db2f5263e Force media capabilities check for HEVC to avoid failure on Windows (#6849)
Fix removeLevel side-effects when removing current level or changing index of loading level
Fixes failed test results: https://github.com/video-dev/hls.js/actions/runs/11844914912/job/33012913783?pr=6845
2024-11-18 14:44:19 -08:00
Rob Walch 2d91f78f73 Program date time, date range, and fragment parsing optimizations
Improve InterstitalEvent object serialization with MediaFragmentRef
2024-11-11 11:18:14 -08:00
Tom MillerandGitHub 7afdcffd3b Fix back buffer not being flushed when backBufferLength is set to 0 (#6781) (#6784) 2024-10-21 13:51:55 -07:00
Rob WalchandGitHub 2299042f74 Add import/order eslint rules and run npm run lint:fix (#6378) 2024-10-10 07:44:14 -07:00
Rob WalchandRob Walch c8ee777226 Handle Interstitials with empty asset-lists (skip to resumption offset or abutting interstitial) 2024-10-09 10:50:30 -07:00
Rob Walch a1a827d66e Merge branch 'patch/v1.5.x'
* patch/v1.5.x:
  Fix content-steering when starting with a single pathway and cloning another without a pathway change (#6760) Fixes #6759
2024-10-08 16:00:06 -07:00
Rob WalchandRob Walch 8a96fe9c51 Fix content-steering when starting with a single pathway and cloning another without a pathway change
Fixes #6759
2024-10-08 15:15:54 -07:00
Rob WalchandGitHub 06f0e755d4 HLS Interstitials Support (#6591) 2024-10-03 15:19:12 -07:00
Rob WalchandGitHub 2b1e1aad82 Align live playlist updates to end of last when there is no overlap (#6692)
* Align live playlist updates to end of last when there is no media-sequence/disconitinuity overlap and no PDT
Resolves #6685
(duplicate of #5282)

* Maintain start as long as there are no skipped segments and new details have no sliding
2024-09-17 12:13:51 -07:00
Rob WalchandRob Walch 6a190fcec0 Parse multiple pssh from "encrypted" init data and fix Widevine key I… (#6640)
* Parse multiple pssh from "encrypted" init data and fix Widevine key ID extraction for playlist match
Fixes #6636

* Logging and assertion improvements per @cjpillsbury's review

* Logging and assertion improvements per @cjpillsbury's review

(cherry picked from commit a960251460)
2024-08-21 18:08:01 -07:00
Rob WalchandGitHub a960251460 Parse multiple pssh from "encrypted" init data and fix Widevine key I… (#6640)
* Parse multiple pssh from "encrypted" init data and fix Widevine key ID extraction for playlist match
Fixes #6636

* Logging and assertion improvements per @cjpillsbury's review

* Logging and assertion improvements per @cjpillsbury's review
2024-08-21 18:05:54 -07:00
9da3d96d2c Support setting targetLatency (#6473)
* Allow setting targetLatency

* fix prettier warnings

* fix failing test liveSyncOnStallIncrease

* restore test liveSyncOnStallIncrease

---------

Co-authored-by: Rob Walch <robwalch@users.noreply.github.com>
2024-07-01 08:05:44 -07:00
vk342andGitHub 8555f8b09c Add liveSyncOnStallIncrease config option (#6455)
* add liveSyncOnStallIncrease config option

* update hls.js.api.md
2024-06-28 14:04:23 -07:00
Rob WalchandGitHub aed1b4b39d Sync audio fragment loading with main discontinuity and time (#6491)
* Sync audio fragment loading with main discontinuity and time

* Fragment finder and Append Error fixes
2024-06-13 13:55:26 -07:00
Rob WalchandGitHub 514cc10260 DateRange parsing and validation enhancements for Interstitials (#6213)
* DateRange parsing and validation enhancements for Interstitials
Warn on invalid quoted-attribute attributes (missing quotes)
Related to #6203

* Shift DateRange metadata Cue times when media timeline is shifted
Fixes #6203

* Map DATERANGE tags to Segments with starting program date time

* DATERANGE tags after the last PDT tag that start at or after that tag should be anchored to that tag

* Handle DateRange mapping with Delta Playlist updates
Error (but parse and merge) multiple EXT-X-SKIP tags
2024-06-05 17:08:26 -07:00
Evan BurtonandRob Walch bc81478d36 Fix missing details if subtitle changed synchronously after loaded and before onLoaded callback (#6424)
(cherry picked from commit a16912b0cb)
2024-05-22 12:34:04 -07:00
Evan BurtonandGitHub a16912b0cb Fix missing details if subtitle changed synchronously after loaded and before onLoaded callback (#6424) 2024-05-22 12:33:28 -07:00
Casey OcchialiniandGitHub 805e55535e Bugfix: use part details to construct CMCD data when available (#6395)
* fix: use part details to construct CMCD data when available
* test: add unit test for part fragment CMCD
Fixes: #6388
2024-05-03 09:52:48 -07:00
Henry McIntyreandRob Walch 1c77fde12b Determine canSkip based on age of last playlist request (#6300)
(cherry picked from commit d802d6013c)
2024-04-10 12:17:55 -07:00
Henry McIntyreandGitHub d802d6013c Determine canSkip based on age of last playlist request (#6300) 2024-04-08 10:55:39 -07:00
Rob WalchandRob Walch 03ca1c7b3f Fix audio/subtitles stream controllers restarting on switch after stopped
Update stream controller access specifiers
2024-02-21 11:02:40 -08:00
Rob WalchandRob Walch 7e9447a35a Block audio append queue to keep AV appends in lock-step 2024-02-19 11:39:58 -08:00
Casey OcchialiniandGitHub 763c129aa3 feat: add support for CMCD nor (#6091)
* feat: add support for CMCD nor
* deps: update @svta/common-media-library to version 0.6.2
Resolves #6088
2024-01-29 09:05:16 -08:00
Rob WalchandRob Walch ac26032af2 User unique logger configurations across instances of Hls(js)
Resolves #2461
2024-01-25 12:04:54 -08:00
Rob WalchandGitHub 3a0856c495 Null inline class JavaScript Event callback properties on destroy (#6102) 2024-01-22 17:41:36 -08:00
Rob WalchandGitHub cd120944fc Fix regression where subtitle options with AUTOSELECT and FORCED are enabled at start (#6094)
* Do not enable subtitle options with AUTOSELECT=YES attribute
* Update and add initial selection tests for subtitle-controller
* Only pick forced subtitle option if it is the only one
Add default field to audio and subtitle selection options and forced field to subtitle selection option
* Address TextTrack change event overriding subtitle preference
Fix _TRACKS_UPDATED and _TRACK_SWITCH event order when preference is selected
* Do not auto select subtitle options with FORCED=YES attribute
2024-01-10 15:42:05 -08:00
Rob WalchandRob Walch 8ec72157a3 Use addEventListener for MediaKeySession events
#6034
2023-12-12 20:00:02 -08:00
Rob Walch a1b505106f Recover from media error after MediaSource ended following SourceBuffer update error event 2023-11-30 16:25:17 -08:00
Rob Walch d4d585b3f5 API enhancements for audio and subtitle selection
Resolves #5532
2023-11-26 10:35:41 -08:00
Casey OcchialiniandGitHub f943d31408 Refactor CMCD controller and tests to use the common media library utilities (#5903)
* refactor CMCD controller and test to use common media library
* update build script to transpile the @svta package
* add ability to specify cmcd keys
2023-11-16 14:39:55 -08:00
Rob WalchandGitHub a99be72ddb Use Content Steering Pathways to manage Redundant Streams (#5970)
* Use Content Steering Pathways to manage Redundant Streams and resolve their errors
* Ensure correct Pathway penalization on Playlist loading errors
* Do not reload Content Steering manifest while media is ended or detached
2023-11-15 09:21:58 -08:00
Rob WalchandGitHub 21213d55c9 Fix subtitle track selection when reusing media element with mismatched TextTracks (#5880)
* Use subtitle track name and language to find and match subtitle/captions TextTrack rather than subtitleTrack index
Resolves #4571

* Fix regression in dev where AUDIO_TRACKS_UPDATED is re-dispatched with zero tracks
Allow selection of audioTrack on AUDIO_TRACKS_UPDATED (overriding default selection - Resolves #5831)
Cleanup selection of subtitleTrack on SUBTITLE_TRACKS_UPDATED (overriding default selection)

* Fix TextTrack use with ASSOC-LANGUAGE
Match the initial default/forced/autoselect choice made when playing HLS in Safari
2023-10-10 11:27:55 -07:00
Rob WalchandGitHub ab34a42505 Handle option grouping for EXT-X-STREAM-INF with same URL and attributes (#5855)
Add VIDEO_RANGE and HDCP attriubute values to Redundant Stream grouping
Add channels and characteristics to MediaPlaylist
Resolves #5302
2023-10-04 11:02:09 -07:00
Rob WalchandGitHub a594323a8f Switch on smaller fmp4 segments that align with buffered segment boundaries (#5804)
Fixes #5743
2023-09-08 14:12:21 -07:00
301be58cc4 Add config flag for maximum front buffer frontBufferFlushThreshold (#5761)
Fixes #5479

Co-authored-by: Evan Burton <eburton2@apple.com>
2023-08-31 14:03:52 -07:00
Rob WalchandGitHub 2e40955d0d Use ManagedMediaSource when available with preferManagedMediaSource config option (#5542) 2023-08-24 16:37:51 -07:00
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>Tom Jenkinson
359197f20b chore(deps): update dependency prettier to v3 (#5646)
* chore(deps): update dependency prettier to v3

* run prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tom Jenkinson <tom@tjenkinson.me>
2023-08-22 11:24:59 +01:00
Rob WalchandGitHub b536883327 Initial selection and level filtering based on preferred codecs and MediaCapabilities (#5704)
* Make initial variant selection based on preferred codec rather than the first variant in the multivariant playlist

* Fix `minAutoLevel` and `ttfb` usage in abandon rules check

* Fix filtering of invalid video-ranges

* Log reason for ignoring start candidates with a particular codec

* Add rendition helper and move SCORE logic into getStartCodecTier

* Add support for MediaCapabilities video configuration filtering
FIxes #5707

* Add support for MediaCapabilities audio configuration filtering
Related to #5704 and #4072

* Add __USE_MEDIA_CAPABILITIES__ build const to remove MediaCapabilities checks from light build

* MediaCapabilities: Assume a framerate of 30fps since decodingInfo will throw with Level default of 0.

* Select variant with alternate video codec on video append error

* Use complete media-parsed codec name when determining if changeType should be appended

* Add `firstAutoLevel` to API.md
2023-08-21 15:24:26 -07:00