Commit Graph
25 Commits
Author SHA1 Message Date
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 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
Jamie StackhouseandGitHub 7e3bda3ead Update buffer-controller.js 2022-03-21 22:50:25 -03:00
albertdaurell da99b8d237 Store track info when buffer codec switched 2021-09-03 15:03:45 +02:00
Rob Walch bdafd25416 Improve handling of SourceBuffer creation errors 2021-03-24 15:45:20 -04: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
Tom Jenkinson 729a36d409 switch to default print width 2020-12-24 13:31:43 +00:00
Rob Walch 536bb7a728 Merge branch 'master' of github.com:video-dev/hls.js into merge-v0.14.0-rc.1-into-feature-v1
* 'master' of github.com:video-dev/hls.js: (68 commits)
  Bump mocha from 7.2.0 to 8.0.1
  Bump eslint-plugin-import from 2.20.2 to 2.21.2
  Fix level-controller altAudio and audioCodecFound determination and update unit tests
  Fix switching between main audio-only in stream-controller and alt audio tracks #2706
  Support playback and audio track switching of audio-only stream with main audio and alt audio
  [Security] Bump websocket-extensions from 0.1.3 to 0.1.4
  Bump netlify-cli from 2.52.0 to 2.53.0
  Bump typescript from 3.9.3 to 3.9.5
  Move hosting of "MP3 VOD demo" to fix failing tests
  Improve findFragmentByPTS and fragmentWithinToleranceTest with regards to selecting the next fragment and handling of tiny fragments Fixes #2776
  Bump @babel/core from 7.10.1 to 7.10.2
  Bump @babel/preset-env from 7.10.1 to 7.10.2
  Bump url-toolkit from 2.1.6 to 2.2.0
  Bump @babel/helper-module-imports from 7.8.3 to 7.10.1
  Bump @babel/plugin-proposal-object-rest-spread from 7.9.6 to 7.10.1
  Bump @babel/plugin-proposal-optional-chaining from 7.9.0 to 7.10.1
  Bump @babel/register from 7.9.0 to 7.10.1
  Bump netlify-cli from 2.51.0 to 2.52.0
  Bump @babel/plugin-transform-object-assign from 7.8.3 to 7.10.1
  Bump karma-coverage-istanbul-reporter from 3.0.2 to 3.0.3
  ...
2020-06-11 14:50:22 -04:00
Rob Walch dd6c9264ce Support playback and audio track switching of audio-only stream with main audio and alt audio 2020-06-09 13:25:26 -04:00
Rob Walch 029147e903 Merge changes from v0.13.2...v0.14.0-beta.1 into feature/v1.0.0
https://github.com/video-dev/hls.js/compare/v0.13.2...v0.14.0-beta.1
2020-04-18 01:12:41 -04:00
Jamie Stackhouseanddependabot-preview[bot] 4b895dd4e6 chore(deps): Sinon refactored and removed sinon.sandbox.create(). 2020-03-20 13:57:19 +00: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 07da07fbc2 Work on getting tests to pass.
Updating them to match the new API.
2019-11-25 17:43:52 -04: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 Bartos a6a7c29137 Initial merge (with errors) 2019-09-11 17:59:11 -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
Jamie StackhouseandJohn Bartos b1cf40a98a GH-2143: Fix flush buffer not accepting undefined types meaning to flush all buffers. 2019-04-17 17:10:39 -04:00
Jamie StackhouseandJohn Bartos cc46ea0d58 GH-2143: Fix flush buffer not accepting undefined types meaning to flush all buffers. (#2190) 2019-03-27 13:46:44 -04:00
John BartosandGitHub 86b4e15d53 Upgrade tests to Chai BDD & optimize runner (#2037)
* Convert tests to Chai BDD

* Invoke mocha with exit so that travis doesnt hang on func test completion
2019-01-25 18:29:37 -05:00
Jamie Stackhouse ea3e1f0775 Convert buffer-controller.js to TypeScript
Thank you to Tom Jenkinson for acting as a reviewer for this work, including writing some suggestions via the GitHub PR github.com/video-dev/hls.js/pull/2073. The commit history has been squashed as it was a fairly lengthly process to get everything working to support the conversion to TypeScript.

Early in the history of this commit, we converted properties to be initialized to `null`. This was incorrect, as it changes the behaviour of code that uses `Object.keys` calls to check if an object has any keys on it. Before, they would be empty, but if the properties are set to null, this check is no longer valid and it changes the behaviour. This is something to look out for in the future of other conversions, as the values themselves are often times reset to the `null`, but begin as undefined.

Added a common `types` folder for interfaces where the ownership of the type wasn't clear for the individual file. The default no-op logger which is the inferred usage did not have any arguments in it's method signature. By adding an argument, TypeScript is able to infer the correct interface. As well the Karma and Webpack configuration had to be updated to enable building TypeScript, and getting testing coverage information from Istanbul.

Define lib "es2015" and "dom" to add HTMLMediaElement, SourceBuffer and Number.isFinite definitions to the TypeScript binary when it is doing type-checking.

When attempting to lint the older version of `typescript-eslint-parser` would emit `no-undef` errors for TypeScript interfaces. Updating the package fixes this issue.

Tom pointed out that we should not use global module declarations to extend default HTML types since users will eventually be importing *.d.ts files from the hls.js project and this would also extend their types. Due to this feedback switched to defining a module local type `ExtendedSourceBuffer`. Which instead extends with the `ended` prop.

Event Handlers were set to be part of the private scope. While this has no effect now, it will be important to ensure other modules do not directly invoke the event handlers. Other methods that were prefixed with a `_` were also set into the private scope.

Where possible, code was switched to early-exit to lower the cognitive load in conditional statements, an example of this was the doAppend method. Another cleanup statement was switching handling of error codes and the comments to be closer to the conditional to which they applied.

Switched to using the Record<Key, Value> type to help support access via the index signature [key: T] syntax in the future.

An issue that was fixed in this commit was that The controller previous exposed the local `pendingTracks` property through the event and did not set the buffer on `this.tracks` instead opting to set it on the individual track, which bubbled up to the pendingTracks object, whose reference was lost in the buffer-controller module. This commit changes this behaviour so that the controller publishes `tracks` from the public variable on the controller rather than the pendingTracks which are passed into createSourceBuffers. This also means that this fixes the `.buffer.buffered` being undefined on the demo page. Added unit tests to cover the new behaviour of throwing an error if createSourceBuffer is called without an attached media element.
2019-01-21 10:09:58 -04:00
John BartosandGitHub e8d95a4354 Fix 0.11.1 Regressions (#2028)
* Create sourceBuffers if the max of 2 tracks has been reached, regardless of buffer codec events received

* Replace Object.values with [].slice.call
2018-12-06 11:14:25 -05:00
John BartosandGitHub 4da2107c1b Refactor sourceBuffer estimation to reflect how Hls.js intends to use the parsed manifest (#1993)
* Determine presence of video in a manifest based on number of levels instead of videoCodecFound

* Rework sourceBuffer count estimation to accurately refelct whether a playlist contains altAudio

* Refactor code to better reflect how BUFFER_CODEC events and pending tracks are related
2018-11-26 15:15:31 -05:00
John BartosandGitHub 1671c9161e Refactor live backbuffer eviction to fit more closely to design goals (#1971) 2018-10-31 17:15:19 -04:00
Vitali BazhkoandJohn Bartos 3e6651d0bf Bugfix/1220 cleanup live back buffer (#1845)
Implement live back buffer eviction
2018-10-26 14:42:10 -07:00