Commit Graph

4011 Commits

Author SHA1 Message Date
Julian Domingo 6610fa3e57 fix: re-open the MediaSource if readyState is not open when the init() method is called. (#7783)
Builds on top of @tykus160's observation in
https://github.com/shaka-project/shaka-player/issues/4903 where
`MediaSource.readyState` was either in a `closed` or `ended` state when
the `MediaSourceEngine.init()` logic is executed.

This fix will simply re-open the `MediaSource` if non-open, resulting in
fewer scenarios where the `MEDIA_SOURCE_OPERATION_THREW` error:
https://github.com/shaka-project/shaka-player/blob/de0f33c2623b057e80b7cafd53e19fac2f984961/lib/media/media_source_engine.js#L648-L651

is thrown because of an
[`InvalidStateError`](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer#exceptions).
2024-12-19 18:37:01 -08:00
Álvaro Velad Galván 60429e93f9 fix: Prefer Dolby Vision p5 over Dolby Vision p8 (#7745) 2024-12-11 14:10:50 +01:00
Álvaro Velad Galván eff0aef8f7 fix(Ads): Limit static overlay playback to the timeline (#7741) 2024-12-11 11:18:52 +01:00
Álvaro Velad Galván 775bc4e44c fix(Xbox): Simplify the use of WebView2 (#7743) 2024-12-11 11:16:27 +01:00
Álvaro Velad Galván c113738a15 fix(Ads): Calculate the mimeType in an earlier step so that there is no impact on the ad playback (#7742) 2024-12-11 11:15:28 +01:00
Álvaro Velad Galván 172e71357c fix(Ads): Don't allow play an overlay video ad using the base video (#7740) 2024-12-11 11:15:17 +01:00
Álvaro Velad Galván 60c88eb05b fix(Ads): Remove iframe border in overlays (#7738) 2024-12-11 07:48:37 +01:00
Álvaro Velad Galván e4825c303b fix(Ads): Fix bad static overlay ad position (#7735) 2024-12-10 17:04:09 +01:00
Álvaro Velad Galván 27976f1c96 feat: Add streaming.preferNativeDash config (#7737)
This is useful for WebOS, because in MSE there is no support for VVC but
there is support for src=
2024-12-10 16:35:06 +01:00
Álvaro Velad Galván 79a481e4ab fix: Fix usage of keySystemsMapping (#7736)
Related to https://github.com/shaka-project/shaka-player/issues/7613
2024-12-10 16:11:01 +01:00
Álvaro Velad Galván 426090db12 feat(Ads): Allow OverlayEvents without viewport (#7734) 2024-12-10 14:04:54 +01:00
Álvaro Velad Galván 656d16c7e0 perf: Reduce calls to isTypeSupported (#7729)
There should not be any call to isTypeSupported if we have already used
Mcap with the same codecs/mimeType
2024-12-09 13:29:38 +01:00
Álvaro Velad Galván 279e6cdd01 fix: Fix support for supplemental codecs (Dolby Vision) (#7720)
Based on the work of @gmcgarry Thank you very much!

Currently the codec adds supplemental codecs to the list of allCodecs
and has an implicit priority order to select a codec. Support for the
codec is tested with MediaSource.isTypeSupported().

There are multiple issues with this approach:

- the priority is implicit
- MediaSource.isTypeSupported() decision is effectively overriding
platform-specific MediaCapabilities logic
- MediaSource.isTypeSupported() is frequently wrong depending on whether
the content is encrypted

This patch duplicates the variant with each supplemental codec and
defers codec priority and codec selection until after
MediaCapabilities.decodingInfo().

This fixes support for DolbyVision Profile 8, which is otherwise broken
because the chromium browsers always return false from
MediaSource.isTypeSupported(), and DolbyVision is commonly only
available in a secure hardware decode pipeline.

Note: Safari does not have this problem since it supports Dolby Vision
in clear

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2024-12-09 12:46:58 +01:00
Wojciech Tyczyński 8dd9d20267 fix: Codec switch reload - apply boundaries correctly (#7700)
Fixes #7595
2024-12-09 12:46:45 +01:00
Iragne 0ca6ff7ae6 fix(DASH): Error due to deleted stream (#7723)
Fixes https://github.com/shaka-project/shaka-player/issues/7722
2024-12-09 10:14:12 +01:00
Joey Parrish 90e47eb58a fix: Avoid stack overflow when stringifying objects (#7721)
Add special case for arrays, for compatibility with frameworks or
polyfills that add properties to Array or Array instances.

Add special case for functions, which always contain circular references
and are unexpected in this context. These seem to appear because of the
frameworks/polyfills mentioned above.

Move everything to ObjectUtils, since this is extremely generic.

Closes #7435
2024-12-06 14:39:19 -08:00
Álvaro Velad Galván e1d1d19555 feat: Add configuration to ignore SCTE214 supplemental codecs (#7717)
Based on the work of @gmcgarry Thank you very much!
2024-12-05 15:14:22 +01:00
Álvaro Velad Galván 554c326e87 chore: Use promiseWithTimeout where possible (#7716) 2024-12-05 11:12:03 +01:00
Álvaro Velad Galván 8db876f6cd feat(Ads): Add support for images and iframes in interstitials (#7712) 2024-12-04 16:10:38 +01:00
Álvaro Velad Galván cd78811753 fix(Ads): Update Alternative MPD to match the latest spec (#7706) 2024-12-04 15:58:17 +01:00
Álvaro Velad Galván 6f4d2d249a feat(Ads): Support HTMLResource on non-linear VAST ads (#7710) 2024-12-04 08:20:50 +01:00
Álvaro Velad Galván 072acf05ff fix(Ads): Only display the secondary video if necessary (#7709) 2024-12-04 06:35:35 +01:00
theodab a1e2f0a2bb fix(preload): Wait for drm keys when preloading (#7698)
Closes #7520
2024-12-03 13:02:13 -08:00
Álvaro Velad Galván f186185cff fix(Ads): Stop properly interstitial ads (#7708) 2024-12-03 16:49:25 +01:00
Álvaro Velad Galván 0c7d2045e9 feat(Ads): Parse non-linear VAST ads (#7702) 2024-12-03 12:58:58 +01:00
Álvaro Velad Galván 4744d1e5ec fix: Allow set maxLatency and minLatency to 0 (#7704) 2024-12-03 11:22:20 +01:00
Álvaro Velad Galván b704af0066 feat(Ads): Add basic support to DASH OverlayEvent (#7701)
The spec is not finalized, but the info can be found at
https://demuxed2024.qualabs.com/home/alex-giladi
2024-12-03 09:57:16 +01:00
Álvaro Velad Galván 87cbf4d90a fix(Ads): Don't try to play Image and HTML overlay interstitials (#7697)
We don't currently support those types of interstitials, so this PR makes the player properly reject them.
2024-11-29 17:01:54 -08:00
Álvaro Velad Galván 743b451c82 fix(Ads): Avoid adding custom interstitials without URI (#7696) 2024-11-29 15:45:26 +01:00
Joaquin Bartaburu b2673fdf4b feat: CMCD v2 LTC and MSD keys (#7412) 2024-11-29 12:31:52 +01:00
Álvaro Velad Galván eb4a45eb44 fix(Ads): Don't dispatch cue points changed if it is an overlay (#7695) 2024-11-29 12:06:54 +01:00
Daniel Mariño 07894ecf14 fix: Timeout unfulfilled request to decodingInfo and requestMediaKeySystemAccess (#7682)
On some (Android) WebView environments,
decodingInfo and requestMediaKeySystemAccess will
not resolve or reject, at least if RESOURCE_PROTECTED_MEDIA_ID is not
set.
This is a workaround for that issue.

Closes #7680
2024-11-29 12:06:32 +01:00
Álvaro Velad Galván 18652b6f36 fix: Fix unload call after destroy (#7690) 2024-11-28 15:24:54 +01:00
Álvaro Velad Galván 1236c2da73 chore(Ads): Simplify quartile management in Interstitials (#7689) 2024-11-28 14:38:03 +01:00
Álvaro Velad Galván 7be22db167 fix(Ads): Avoid skip interstitial when is not allowed (#7686) 2024-11-28 13:13:51 +01:00
Álvaro Velad Galván 7afe08e490 fix(HLS): Fix subtitle timing when no discontinuity but there is X-TIMESTAMP-MAP (#7681)
Fixes https://github.com/shaka-project/shaka-player/issues/7673
2024-11-27 14:14:22 +01:00
Wojciech Tyczyński f765e05985 fix: Detect smooth codec switch support on Apple devices (#7678) 2024-11-27 13:18:16 +01:00
Álvaro Velad Galván 7caa4a1d74 test(Ads): Add more basic Interstitials unit tests (#7674) 2024-11-27 12:18:31 +01:00
Wojciech Tyczyński 9bce9d7f67 chore: Remove code duplication in shaka.media.Capabilities (#7676) 2024-11-27 11:51:20 +01:00
Álvaro Velad Galván 8048d0280d fix(Ads): Fix usage of ENABLE-SKIP-AFTER and ENABLE-SKIP-FOR (#7677) 2024-11-27 11:47:43 +01:00
Álvaro Velad Galván 18ed02c930 fix(Ads): Use region.id as id for Alternative MPD interstitial (#7671) 2024-11-26 16:09:50 +01:00
Álvaro Velad Galván 5be0fc4364 fix(HLS): Ignore errors when try to detect CC (#7668) 2024-11-26 13:03:12 +01:00
Álvaro Velad Galván 4aa9306680 fix(Ads): Fix behavior when user JUMPS across more than one interstitial (#7667)
Fixes https://github.com/shaka-project/shaka-player/issues/7665
2024-11-26 12:01:33 +01:00
Wojciech Tyczyński ff7c465cc0 fix: Fix playback on Apple devices without ManagedMediaSource (#7669)
Fixes #7666
2024-11-26 11:59:10 +01:00
Wojciech Tyczyński 55b7bd0a70 fix: Forbid usage of instanceof ArrayBuffer (#7653)
Fixes #6279
2024-11-26 11:16:00 +01:00
Álvaro Velad Galván 79b1536b5d fix(Ads): Fix id of X-ASSET-LIST (#7662)
Fixes https://github.com/shaka-project/shaka-player/issues/7661
2024-11-26 07:31:04 +01:00
Álvaro Velad Galván 9fd349ab31 fix(Ads): Fix post-roll playback (#7663) 2024-11-26 07:30:36 +01:00
/zɒ̃ge/ 5f8e958ef3 fix: Fix video progress events accuracy (#7654)
Due do rounding errors the progress events were fired way too early (especially the complete event on longer videos). This changes use float comparison to mitigate the issue.
Further improvements (video with start time, seek handling) will be added in follow up PRs.

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-11-25 18:01:25 -08:00
Álvaro Velad Galván d09cd7ecb2 fix(Ads): Fix unnecessary request when using VAST (#7660)
If the URL does not have an extension, using mimeType allows us to avoid
having to make a HEAD type request
2024-11-25 17:27:58 +01:00
Álvaro Velad Galván ef2c7eb970 fix(Ads): Fix ad position by default (#7659)
Regression of
https://github.com/shaka-project/shaka-player/commit/70257ffefe609dfa0bb8888f91c2ce1d52c78f9f
2024-11-25 12:52:18 +01:00