Commit Graph
44 Commits
Author SHA1 Message Date
Rob WalchandRob Walch 7e9447a35a Block audio append queue to keep AV appends in lock-step 2024-02-19 11:39:58 -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
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
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 Walch 3673ce0471 Handle mixed sourcebuffer errors, up to appendErrorMaxRetry consecutive errors per buffer type 2023-07-03 17:06:24 -07:00
Rob WalchandGitHub 11b11deb34 Error and switch on SourceBuffer append requests for non-existing tracks (#5485)
* Error and switch on SourceBuffer append requests for non-existing tracks
(muxed "audiovideo" append over unmuxed "video" and "audio" SourceBuffer)
Related to #1510

* Handle queued appends for pending source buffers
2023-05-26 18:41:47 -07:00
8e6efb1c12 Migrate to Rollup with new ESM target and improved Worker support (#5299)
* Convert build packager to rollup
* Add an es module target (#2910)
* UMD build worker injection (#5107)
* Add ES5 syntax check for UMD builds (#5301, #5288)
* Add common rollup config
* handle `self` not existing (happens in nodejs. The check that makes sure the dist file can be required in node and not throw was failing because of this.)
* Disable coverage in CI
* Add `config.workerPath` option and "hls.worker.js" build output (#5107)
* Include transmuxer-interface id ("main" and "audio") in Web Worker setup and error logs

Co-authored-by: Tom Jenkinson <tom@tjenkinson.me>
2023-03-27 11:03:39 -07:00
Rob WalchandGitHub 8063580aa0 Error Handling controller and LoadPolicies (#5241)
* Implement ErrorController …
Add Error Handling Integration Tests
Handle missed probe transmux probe with with FRAG_PARSING_ERROR
Handle encrypted init segment and subtitle decryption failure with FRAG_DECRYPT_ERROR
Remove delay when retrying after timeout
Trigger FRAG_LOADING after request is made
ERROR event data type must include an error property
Add stats to network loader error callbacks to allow error handling to use request timing
Remove use of console.warn from mp4-tools
Add missing TypeScript type exports

* Remove console.assert statements
Resolves #5218
Closes #5221

* Remove unused frag buffered monitor

* Add Load Policies and deprecate frag/level/manifest timeout and retry config options

* Switch on FRAG_PARSING_ERROR or continue trying fragLoadPolicy.default.errorRetry.maxNumRetry (6) times
Fixes #5011

* Switch on FRAG_PARSING_ERROR or continue trying fragLoadPolicy.default.errorRetry.maxNumRetry (6) times 2/2
Fixes #5011

* Do not reload level after calling stopLoad() and startLoad()
Warn on currentFrag context reference change and use currentFrag to maintain correct stats ref
Fixes #5230

* Implement ErrorActions and Pathway Switching

* Fix part timeout handling
Cleanup frag stats handoff

* Update retry rules to require http status or timeout error (deprioritizes retry on parse errors)

* Retry audio and subtitle playlist loading after failure on level switch when no alternate is available
2023-02-27 11:31:16 -08:00
Rob WalchandGitHub 766ec37691 Content Steering (#5191)
* Load Steering Manifest

* Make UA check lazy for legacy unsupported MP3 in MP4 container check

* Add Redundant Streams tests

* Add FRAME-RATE to Redundant Stream group key and level sorting
Optimize MANIFEST_PARSED level filtering
Optimize Media Playlist check

* Do not group Variant levels with PATHWAY-ID into Fallback Stream URLs (unless building without Content Steering support)
Store and return seperate LevelAttributes per Fallback Stream URL
Align Level audio and text group ids with Fallback Stream URLs (Level._urlId)

* Content Steering Pathway grouping and selection
#5074

* Support removeLevel and improve capLevelController with level index changes

* Pathway Clone Variants

* Pathway Clone Rendition Groups

* Fix audio track alignment with timescales that differ and smooth switch when attributes do not change

* Always emit LEVEL_SWITCHING on Pathway change to ensure audio and subtitle tracks update as well

* Fix unregister listeners in fps and latency controller

* Unit test clean up

* Update README for Content Steering
2023-02-18 12:20:14 -08:00
Rob WalchandGitHub ab06d97971 Log error and detach if MediaSource 'sourceopen' is interrupted (#5206) 2023-02-07 15:00:39 -08:00
Rob Walch bfacbf9957 Clear muxed "audiovideo" SourceBuffer on BUFFER_FLUSHING without SourceBufferName type
Resolves #3850
2021-05-03 19:50:45 -04:00
Rob Walch f153d88a0d Prevent back-buffer BUFFER_FLUSHED callbacks from resetting stream state to IDLE while fragments are loading
Set stream controller state to IDLE when fragment loading/parsing/appending is aborted or fails
Evict back-buffer on FRAG_CHANGED at TARGET_DURATION intervals making fewer MSE remove requests
Emit FRAG_CHANGED on part change and fix other methods relying on `getAppendedFrag` for ranges where only parts were buffered
Only emit LIVE_BACK_BUFFER_REACHED in live streams
2021-03-04 12:38:19 -05:00
Rob WalchandGitHub 142643dac2 Merge pull request #3463 from redoPop/backbuffer
Support the backbuffer constraint in VOD content
2021-02-17 11:42:24 -05:00
Rob Walch 0a40563bc7 Normalize buffer append event properties 2021-02-17 00:37:37 -05:00
Joe Bartlett 7d8b282e65 Provide support for LIVE_BACK_BUFFER_REACHED
Per 3b07036 the LIVE_BACK_BUFFER_REACHED event is technically part
of the public API and should be supported as a deprecated event.

Generics convention enforcement prohibits creating an alias of the
BACK_BUFFER_REACHED event, so this commit adds a duplicate for the
old name.
2021-02-11 20:40:45 -06:00
Joe BartlettandGitHub 8560c6415e Merge branch 'master' into backbuffer 2021-02-11 08:26:41 -06:00
Joe Bartlett 300631f288 Support backbuffer constraint in VOD content
Per conversation in #3457 this commit adds a backBufferLength
configuration to set the backbuffer constraint for both live
and VOD content.

The original liveBackBufferLength config property has been
deprecated and defaults to null, but is still supported
for live content.
2021-02-09 09:02:03 -06:00
Jamie Stackhouse 793b34fd43 Setup API extractor. 2021-02-07 14:33:39 -04:00
Rob Walch 4057e22f6b Fixes for liveDurationInfinity seekable range in demo and buffer-controller
Fixes #3055
Improves #2784
2020-12-29 13:23:17 -05:00
Tom Jenkinson 729a36d409 switch to default print width 2020-12-24 13:31:43 +00:00
Tom Jenkinson 7342d4a6db run 'npm run prettier' 2020-12-23 20:15:35 +00:00
Rob Walch 1ad36478b1 Merge branch 'master' into feature/v1.0.0
* npm update and TypeScript 4.1 Promise<void> fixes
2020-12-21 21:31:40 -05:00
Rob Walch 8d0398bb75 Improve remuxing of non-independent segments and backtracking
Fixes #2808
2020-12-21 18:26:03 -05:00
Rob Walch 6a8d72c680 Set media duration when attaching after level update
Fixes cause of intermittent functional test failures (+1 squashed commit)
Improve VOD seek functional test: fail on non-finite duration.
Logging fixes
2020-12-18 22:10:34 -05:00
Rob Walch 8ec2ea0f1f Do not split fmp4 bytes in non-progressive mode (fixes CMAF part loading, and reduces memory copying)
Use a single transmuxer session for contiguous streams
Use part data in ABR estimation
Send FRAG_LOADED event for each part loaded
Sync audio tracks to main using PDT initially
Include part index in more fragment streaming logs
Make buffer blocking always async so that we never get stuck in an load-abort-buffer loop
Fix part loading fragment loaded/total estimation
Clear fragment elementary info and stats.loaded when removing fragment from fragment-tracker
2020-11-11 18:24:10 -05:00
Rob Walch feff66be1e Use part stats for bandwidth estimate when part is buffered 2020-11-06 14:04:06 -05:00
Rob Walch 9e446e63f3 Remove ID3 cues when buffer is flushed
Cleanup live backbuffer removal
Cleanup fragment-tracker eviction from buffer flushes
Load main fragment at `this.nextLoadPosition` when loading candidate is already loaded
2020-10-02 23:04:44 -04:00
Rob Walch 8cdc2cb5d2 Cleanup fragment loader part handling and event typing
Run type checks on test files
2020-09-22 19:48:52 -04:00
Rob Walch 75f42df2af Improve part parsing and fragment class 2020-09-22 19:20:31 -04:00
Jamie Stackhouse 050694ff0a Update tests to have a first parameter as the event name. 2020-01-11 02:08:05 -04:00
Jamie Stackhouse 6bb71c83fb Working towards making event emitter less of a breaking change. 2020-01-11 00:46:31 -04:00
Jamie Stackhouse 07da07fbc2 Work on getting tests to pass.
Updating them to match the new API.
2019-11-25 17:43:52 -04:00
Jamie Stackhouse ac806c6671 Merge remote-tracking branch 'origin/feature/v1.0.0' into strict-event-emitter 2019-11-14 20:58:28 -04:00
Rob Walch 8c12299e57 Load approximately 3 seconds of content when no buffer is available
Load up to one second at a time for live and when buffer is low,
and whole fragment without progress for VOD with 2x target duration buffer
2019-11-11 18:28:53 -05:00
Rob Walch 68fb4010c8 Fix unit tests 2019-11-06 21:29:13 -05:00
Jamie Stackhouse ec1e2b4731 Rename Event -> Events Enum. Move from default to named export.
Named exports can be more easily tree-shook or deadcode detected by the
available options that can do that, so using them over default exports
could make a future optimization easier to do.
2019-10-14 21:29:31 -03:00
Rob Walch d26bd47c54 Type and typo fixes 2019-10-04 18:40:03 -04:00
Tom Jenkinson 1b5de9d5de enable 'dot-notation' rule 2019-09-28 10:50:37 +01:00
Rob Walch 3a55d4df3b Address test issues 2019-09-16 20:33:23 -04:00
John Bartos 8a97c9b49d Fix lint errors 2019-09-12 11:53:39 -04:00
John BartosandGitHub 8466138ef1 Rework stats recording to be accurate for progressive parsing (breaking change) JW8-9959 (#239) 2019-08-19 17:47:03 -04:00
John BartosandGitHub e827921561 Allow progressive streaming to be dynamically toggled JW8-9731 (#233)
* Allow progressive streaming to be dynamically toggled JW8-9731

* Respect config.loader choice if set by developer
2019-08-07 14:38:55 -06:00
John BartosandGitHub 488eeaf1d5 [JW8-9270] Cancel progressive fragment load when seeking outside the buffered range (#217)
* Refactor seek handler to always cancel fragment load if the loader exists, regardless of controller state

* Refactor fragment timing to only update on transmux complete instead of every progress event
2019-06-03 11:45:22 -04:00
John BartosandGitHub b907d45574 Refactor buffer-controller to execute all sourceBuffer actions via queues (#208)
* Refactor buffer-controller to execute all sourceBuffer actions as enqueued operations 

These changes ensure that Hls.js is able to ensure order of SB operations, as well as prevent progressive appends from deadlocking other operations

JW8-8934
2019-05-07 17:41:58 -04:00