Commit Graph

4214 Commits

Author SHA1 Message Date
Álvaro Velad Galván 88fa16744d fix(HLS): Detect spatial audio when using Dolby AC-4 (#8223) 2025-03-11 18:14:37 +01:00
Álvaro Velad Galván 13a1340a4f fix: Only dispatch spatialvideoinfo and nospatialvideoinfo for video streams (#8236) 2025-03-11 06:30:20 +01:00
Matthias b9c6345192 fix: Text tracks disappear when crossing a boundary in RESET mode. (#8240)
Text track handling is not managed by MSE but by ourselves, thus we do
not need to discard text references.

As we do not reset the text engine alongside MSE, text tracks would
simply disappear when crossing a boundary and MSE was reset.
2025-03-10 18:29:44 +01:00
Matthias 369916489e feat: Add config to allow reset MSE on cross boundary (#8156)
There's devices out there that are not compliant with the MSE spec. Such
as halting MSE when a secondary init segment is appended (webOS 3), or
failing to transition from a plain to encrypted init segment (Tizen
2017). While we initially prefer content workarounds, it's a time
consuming and trial & error process. For some devices it might not be
worth investing time into finding a proper workaround due to low usage.
We're giving people an alternative by resetting MSE when needed
(configurable). dash.js offers somewhat similar behavior
[here](https://github.com/Dash-Industry-Forum/dash.js/blob/a656ec709e7f92f76b392bf196ee9883da7928ce/src/streaming/controllers/StreamController.js#L672),
where MSE is reset before applying an encrypted init segment.

This PR introduces `crossBoundaryStrategy` in `StreamingConfiguration`.
It can be configured as following:

- KEEP - we're keeping MSE active, this is the default and the current
behavior.
- RESET - we'll always reset MSE when it crosses a boundary.
- RESET_TO_ENCRYPTED - we reset MSE when it crosses an encrypted
boundary, and we keep MSE afterwards. Additionally, we're not going to
reset when we're crossing a plain to plain boundary.

Each initSegmentReference now holds an `encrypted` and `boundaryEnd`
value. When configured with a different value than KEEP,
`StreamingEngine` will be instructed to fetch and append segment
references up until the boundary of the currently applied init segment.

We detect whether we're at a boundary in a few ways:

- Listening to the HTML5 MediaElement's `waiting` event, this'll
indicate that we do not have enough buffer to advance. If we're pretty
close to the boundary, we assume we're at the boundary.
- Due to subtle differences in the segment alignments, waiting wasn't
reliable. When close to a boundary, a timer is fired with the assumption
that "we'll reach the boundary at soon". I've set the threshold to 1
second, when playhead is further than the threshold, we'll skip checking
whether an MSE reset is due.

The implementation relies on the added properties in the init segment
reference, and the concept of a "Period" is avoided in StreamingEngine
to ensure it's compatible with HLS too.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-03-07 10:45:31 +01:00
Matthias b8519f1529 fix: When standard load, do not wait for pending license requests to finish. (#8219)
Fixes https://github.com/shaka-project/shaka-player/issues/8214
2025-03-07 10:34:48 +01:00
Álvaro Velad Galván 84c73f8825 chore: Remove unnecessary code (#8220) 2025-03-06 18:07:47 +01:00
David HM Morgan 18695c6c23 feat: Text font scaling customisation ability (#8215)
With reference to #8025, this is a partial proposal to see if this style
of extensible customisation could be favourable to the shaka-player
community:

Proposal for some accessibility options whereby an App builder can
customise subtitle/caption size, with the potential of an App offering
accessibility options for text size.

This style could be used for other text styling attributes in a similar
way, but this is just the first step.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-03-06 13:44:49 +01:00
Álvaro Velad Galván c2ce68fba8 feat: Move shaka.util.FairPlayUtils to shaka.drm.FairPlay (#8217) 2025-03-06 12:43:49 +01:00
Álvaro Velad Galván 9ba31325ea chore: Move isMediaKeysPolyfilled to DrmUtils (#8216) 2025-03-05 16:03:48 +01:00
Álvaro Velad Galván 04658d17f7 fix(HLS): Only apply compensation if the difference is greater than 150ms (#8207)
Fixes https://github.com/shaka-project/shaka-player/issues/8200
2025-03-04 13:18:56 +01:00
Álvaro Velad Galván 051da08adc fix(UI): Update UI in order to support AC-4 (#8205) 2025-03-04 11:59:51 +01:00
Wojciech Tyczyński 235fbea2a9 perf: Region timeline improvements (#8203)
- Only run filter timer if we have any region cached
- use map for faster lookup
2025-03-04 11:42:49 +01:00
Joshua Hull 31b32d3d24 feat(FairPlay): Add support for Mux (#8201)
This adds support for FairPlay DRM license requests for Mux.io

Close https://github.com/shaka-project/shaka-player/issues/8202
2025-03-04 11:26:36 +01:00
Álvaro Velad Galván 61d44c903f fix: Clear some caches when install/uninstall PatchedMediaKeysApple (#8198)
Related to https://github.com/shaka-project/shaka-player/issues/8190
2025-03-03 16:00:50 +01:00
Álvaro Velad Galván 2d0995f58b fix: Fix codec selection (#8197)
Fixes ccbbb01e55 that broken codec
selection on
https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd
2025-03-03 14:55:51 +01:00
Álvaro Velad Galván be12a7f132 build: Move EBML parser to dash to improve the build size (#8189) 2025-02-28 15:14:39 +01:00
Álvaro Velad Galván 4e05551986 feat: Allow preload text tracks and expose the preloaded variant and text tracks (#8187) 2025-02-28 15:14:25 +01:00
Wojciech Tyczyński bcf159d62a fix: Prevent race condition when seeking backwards during load (#8188) 2025-02-28 15:06:18 +01:00
Álvaro Velad Galván 870a3f06b9 perf: Pause PlayheadObserverManager operations on pause event (#8183) 2025-02-28 11:31:44 +01:00
Álvaro Velad Galván 5debddcf4d chore: Add encrypted flag to init segments (#8182) 2025-02-27 14:10:32 +01:00
Álvaro Velad Galván 6c01f18f6d fix: Fix seek to initial live position on slow devices (#8181)
Fixes https://github.com/shaka-project/shaka-player/issues/8175
2025-02-27 12:29:48 +01:00
Álvaro Velad Galván eda85d6607 test: Fix crash of Firefox on Windows (#8173)
Fixes 9aea3587ef as it should only occur
with ClearKey
2025-02-26 15:53:35 +01:00
Álvaro Velad Galván 6ffc30210e fix: Remove timeout for decodingInfo in some platforms and increase the timeout (#8172) 2025-02-26 15:37:27 +01:00
Álvaro Velad Galván 389f45c215 feat: Add LCEVC dual track rendering (#8168) 2025-02-26 12:43:24 +01:00
David Pfister b26dd1f777 fix: Fit template check template info (#8162)
`TimelineSegmentIndex` `fitTimeline` doesn't check if `templateInfo` is
null. This means it errors in this case when it tries to access the
`timeline` property. It now exits early if it's null
2025-02-26 08:05:29 +01:00
Álvaro Velad Galván 65ad917d82 chore: Create a new method appendDependency in MediaSourceEngine (#8157)
This simplifies the integration of LCEVC Dual Track.
2025-02-25 12:36:14 +01:00
Álvaro Velad Galván 2573af7bd7 fix: Avoid DRM setup for VOD that does not need it (#8154)
Now we only set up DRM in advance for live streams that might add it
later.
2025-02-25 10:43:41 +01:00
Álvaro Velad Galván 433a32ab94 fix(HLS): Populate encrypted info correctly on updates (#8153) 2025-02-24 19:53:35 +01:00
Álvaro Velad Galván 61af2cf47b chore: Simplify gapPadding config (#8150) 2025-02-24 14:48:27 +01:00
Álvaro Velad Galván 3338ea7a64 fix(CMCD): Do not call play() if CMCD is not enabled (#8149) 2025-02-24 11:57:16 +01:00
Álvaro Velad Galván 723db424e4 chore: Unify GapJumpingController and StallDetector in the same file (#8148)
This helps debugging issues easier by having everything in the same
file. It also allows you to align your implementation with what hls.js
and dash.js do.
2025-02-24 11:54:53 +01:00
Álvaro Velad Galván c080f851f7 chore: Simplify StallDetector (#8141)
Related to https://github.com/shaka-project/shaka-player/issues/3673
2025-02-21 15:49:07 +01:00
Álvaro Velad Galván 8f0b0e3282 feat(LCEVC): Detect as supported dual track content with LCEVC (#8134)
This PR does not yet add enhancement layer decoding support.
2025-02-21 13:28:56 +01:00
Joey Parrish 450fb5943c test: Reject all FF+Windows ClearKey testing (#8122)
My previous change, #8109, didn't go far enough. In a full test run,
some ClearKey tests still crash Firefox in the lab. By removing it from
the support dictionary used to gate DRM tests, we ensure all ClearKey
tests are skipped.
2025-02-20 08:54:10 -08:00
vlazh ccbbb01e55 fix: Check bandwidth when filtering streams (#8125)
Fixes #8124.
2025-02-20 17:29:03 +01:00
Wojciech Tyczyński ec37591617 fix: Fix Hisense 4K detection (#8133) 2025-02-20 17:26:23 +01:00
Álvaro Velad Galván c312bd6186 feat: Allow acquire thumbnails without track ID (#8129) 2025-02-20 14:35:30 +01:00
Álvaro Velad Galván 5c3e1a0fea fix(DASH): Revert Dolby Atmos detection when there is not SupplementalProperty (#8132)
Reverts
https://github.com/shaka-project/shaka-player/commit/cf581cd039db62b658f6851590b6c623bd7bf924
Reverts
https://github.com/shaka-project/shaka-player/commit/56c5f52c9a69d87f005163f7d0def1a49d8d599d
2025-02-20 14:23:40 +01:00
Álvaro Velad Galván 31373b3fea perf: Close segmentIndex after getAllThumbnails (#8128) 2025-02-20 11:23:39 +01:00
Álvaro Velad Galván 65da004a48 fix(DASH): ContentSteering promise is resolved too late for fetching of init segment (#8126)
Fixes: https://github.com/shaka-project/shaka-player/issues/8123
2025-02-20 11:21:02 +01:00
David Pfister 49706b9ea4 perf: Remove promises from getAllThumbnails loop (#8118)
`getAllThumbnails` creates an array of promises when grabbing each
thumbnail. This is because `getThumbnails` might have to create a
segment index, but `getAllThumbnails` already does this. This separates
`getThumbnails` into two functions so `getAllThumbnails` can get the
thumbnails synchronously.
2025-02-19 19:46:12 +01:00
Álvaro Velad Galván cbcb1d8b19 perf(Ads): Only create the listeners/timers when there are interstitials (#8113) 2025-02-19 18:41:26 +01:00
Álvaro Velad Galván 356de09850 perf(UI): Avoid unnecessary calls to controls configure (#8116) 2025-02-19 15:45:26 +01:00
Álvaro Velad Galván f3108330c6 perf: Only set the timers on UITextDisplayer when there are cues (#8114) 2025-02-19 13:34:21 +01:00
Álvaro Velad Galván 324b1212de fix(FairPlay): Install by default shaka.polyfill.PatchedMediaKeysApple on older Safari versions (#8106) 2025-02-19 10:20:56 +01:00
Álvaro Velad Galván 75709351c8 fix: Remove isSafari and always use isApple (#8104)
This replacement is safe to do and also reduces the number of internal
operations to obtain the result.
2025-02-19 10:07:35 +01:00
Joey Parrish 9aea3587ef test: Fix crash of Firefox on Windows (#8109)
Our automated test lab runs Windows browsers under a headless service.
In this environment, Firefox's ClearKey CDM seems to crash when we
create the CDM in probeSupport().

To avoid this, we check for a debug or uncompiled build running in
Firefox on Windows, and if this combination is found, we skip
createMediaKeys() in probeSupport().

Because the check uses the compile-time constant goog.DEBUG, we avoid
any penalty in a production build.
2025-02-18 21:37:16 -08:00
Álvaro Velad Galván 1a6b533c7e chore: Simplify older Chromecast detection (#8105) 2025-02-18 21:29:12 +01:00
Wojciech Tyczyński 09b3333afe fix: Install Safari workarounds on WPE STBs (#8103)
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-02-18 15:34:47 +01:00
Álvaro Velad Galván 7704a31ab2 perf: Use navigator.userAgentData.platform to detect Android and Fuchsia (#8102)
More info: https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform
2025-02-18 14:03:04 +01:00