Commit Graph

263 Commits

Author SHA1 Message Date
Wojciech Tyczyński 6a4e95bfae fix: Reduce calls to EME by ignoring MIME type in MediaKeySystemAccess cache (#7374)
Fixes #7325
2024-09-26 11:28:07 -07:00
Agajan J. 58f666ba7a fix: Disable Encryption Scheme Polyfil On Some Devices (#7355)
Fixes https://github.com/shaka-project/shaka-player/issues/7354
These platforms don't support `encryptionScheme`, so there is no need to
install this polyfil.
2024-09-24 07:17:36 +02:00
Wojciech Tyczyński 65e66813aa fix(net): Remove AbortController polyfill (#7149)
`AbortController` polyfill attaches to the global object and it messes up with feature detection for projects that are using shaka. As it is not able to properly abort ongoing requests, it doesn't give much value.
2024-08-21 08:51:44 -07:00
Joey Parrish c97e689043 chore: Update AbortSignal polyfill for new compiler (#7176)
This upgrades the compiler and reworks the AbortSignal polyfill to match
the new compiler externs for that class. This is important to make Shaka
Player compatible with the latest compilers in use inside Google.

Note that the Closure compiler is deprecated, so this should be our
final upgrade. We will some day move to TypeScript.

This does _not_ update the Closure library, because the latest version
causes failures we don't understand in the loading mechanism in
test/test/boot.js.
2024-08-20 11:19:46 -07:00
Álvaro Velad Galván fcd87aa327 fix: Fix MSE polyfill for iOS (#7049)
Fixes https://github.com/shaka-project/shaka-player/issues/7048
2024-07-16 12:04:45 +02:00
Wojciech Tyczyński 3b0a035473 chore(DRM): Move util methods from DrmEngine to DrmUtils (#6960)
As we already have `DrmUtils`, try to cut few lines from `DrmEngine`.
2024-07-01 17:35:31 +02:00
Wojciech Tyczyński 309bd72046 fix(DRM): close properly webkit media key sessions (#6775)
On WebOS 3.0 we've noticed an issue in production, where TVs are slowly
starting to throw the following error after a user has watched at least
30+ episodes: `Code: 6006 Category: 6 Severity: 2 ["EME v0.1b key
error",{"errorCode":{"code":1,"systemCode":65535}},"0xffff"]` and can
only be resolved by clearing the app cache, or unplugging the TV.
Further investigation revealed that current workflow, where MSE is
destroyed before DRM Engine causes that old EME implementation is not
able to close session properly.
2024-06-11 08:22:14 +02:00
Wojciech Tyczyński 97910dc8a9 fix: Support for Zenterio (#6717)
Few bugfixes to support DT Zenterio platform:
- Zenterio seems to have a problem with the EME onKeyStatus event payload (the key statuses map), where the map key ID comes in as empty. This is not correct based on the EME spec:
https://w3c.github.io/encrypted-media/#dom-mediakeysession-keystatuses
- Add polyfills that are used to fix issues with older webkits, same as for older safari browsers
2024-06-03 10:07:04 -07:00
Wojciech Tyczyński 9e26166c40 fix: patch setServerCertificate() on older Tizens & webOS (#6696)
We've tried to enable setting server certificates to optimize playback
start, but turned out that with our widevine certificate shaka was
throwing 6004 error. The issue is not reproducible starting from Tizen
5.5. The same certificate was working properly also on Chrome.
2024-05-29 11:07:17 +02:00
Álvaro Velad Galván 00c5c1da16 fix(Cast): Incorrect detection of MediaCapabilities on Chromecast (#6656)
Fixes https://github.com/shaka-project/shaka-player/issues/5776
2024-05-28 09:03:55 +02:00
Wojciech Tyczyński e0eeb5b77d feat: add config to clear decodingInfo cache on unload (#6678)
On PlayStation, cached `MediaKeySystemAccess` objects may corrupt after
several playbacks, and they are not able anymore to properly create
`MediaKeys` objects. To prevent it, clear the cache after each playback.
Make it configurable via `streaming.clearDecodingCache`.
2024-05-27 14:10:33 +02:00
Joey Parrish 9c1e621c7a test: Fix test environment access to cast.__platform__ (#6553)
This shim requires the latest version of the Chromecast WebDriver Server's receiver app, which can receive messages and proxy async access to `cast.__platform__`.
2024-05-08 14:15:09 -07:00
Álvaro Velad Galván 5a0e60ac0b feat: Add encryptionScheme support on MCap polyfill (#6482)
Related to https://github.com/shaka-project/shaka-player/issues/1419
2024-04-26 09:07:34 +02:00
Álvaro Velad Galván 7e32636096 fix: Reject TS content on all platforms and transmux always (#6382)
Related to https://github.com/shaka-project/shaka-player/issues/6334
Related to
https://github.com/shaka-project/shaka-player/issues/6320#issuecomment-1979835203
Also reverts https://github.com/shaka-project/shaka-player/pull/6045
since now it is not necessary
2024-04-03 08:33:05 +02:00
Álvaro Velad Galván 12bf6428e0 fix: Add ManagedMediaSource support in MediaSource polyfill (#6361) 2024-03-29 09:53:18 +01:00
Álvaro Velad Galván 30285b2439 perf(Cast): memoize/cache canDisplayType results to reduce startup latency (#6367)
Related to
https://github.com/shaka-project/shaka-player/issues/5776#issuecomment-1934955286
2024-03-26 07:38:22 +01:00
Joey Parrish bf6455c326 chore: Remove storage estimate polyfill (#6343)
This is not needed since Chrome 61 and was not even registered in
uncompiled mode. (An audit of polyfills found this was the only one
missing from uncompiled mode.)
2024-03-15 10:36:42 -07:00
Joey Parrish b8905bd8d4 fix(Cast): Force TS content to be transmuxed on Chromecast (#6262)
Although Chromecast natively supports TS content, it does not work in
all cases. In particular, we have some sample live streams where some TS
segments can be parsed by external tools as valid TS, but cause the
Chromecast to throw a parsing error.

We should reject TS content on Chromecast, and allow the builtin
transmuxer to take over parsing.

This also removes the use of `cast.__platform__.canDisplayType` to patch
MediaSource.isTypeSupported on Chromecast. Current versions of Shaka
Player are doing very rough filtering with isTypeSupported before
calling MediaCapabilities.decodingInfo. And our MediaCapabilities
polyfill calls `cast.__platform__.canDisplayType` directly, bypassing
any polyfill we might install on isTypeSupported. So there is no longer
any purpose to canDisplayType in isTypeSupported.

Closes #5278
2024-02-21 09:43:40 -08:00
Mathieu Côté 08cc34a532 fix: AC-3 audio codec support on Tizen (#6166)
Fixes https://github.com/shaka-project/shaka-player/issues/6160
2024-01-26 15:29:25 +01:00
Álvaro Velad Galván 4e47acda0c fix: Fix detection of spatial rendering support in Cast (#6138)
See https://developers.google.com/cast/docs/media#audio_passthrough
2024-01-24 07:39:34 +01:00
Álvaro Velad Galván 3ce439978d revert: Install by default shaka.polyfill.PatchedMediaKeysApple when there is no unprefixed EME support (#6068)
This reverts commit 5b5b2ce174.

Due to:
https://github.com/shaka-project/shaka-player/commit/b1e5063cb8f17747bad40836c3c612224e2811a5#commitcomment-136674454
2024-01-10 09:25:21 +01:00
Álvaro Velad Galván 5b5b2ce174 fix: Install by default shaka.polyfill.PatchedMediaKeysApple when there is no unprefixed EME support (#6053) 2024-01-08 19:07:59 +01:00
Álvaro Velad Galván 2eedb12a1e feat: Add support for WPE based browsers in RDK set-top boxes (#5852)
Closes https://github.com/shaka-project/shaka-player/issues/5134
2023-11-05 09:04:30 +01:00
theodab ed93a0cb12 fix: Fix exiting fullscreen on Safari (#5439)
`screen.orientation.unlock` is not defined on Safari, even though `screen.orientation` is.
This changes our orientation polyfill to add that method to `screen.orientation`.

Fixes #5437
2023-07-26 12:08:36 -07:00
Steve Anton 72e13c4b06 chore: Add polyfill for AbortSignal.throwIfAborted() (#5412) 2023-07-12 12:42:22 -07:00
FernandoGarciaDiez eb01c60b27 fix: Tizen video error fixed by checking the extended MIME type (#4973)
Fixes #4634
2023-03-06 13:26:53 -08:00
Casey Occhialini 50d0645a1e fix: Fallback to isTypeSupported when cast namespace is undefined (#5012)
Resolves #5010

---------

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2023-02-28 13:50:53 -08:00
Álvaro Velad Galván 7da65a197a chore: the implementation of abort() on SourceBuffer in Safari, now works (#5044)
See: https://bugs.webkit.org/show_bug.cgi?id=165342

Tested on Safari 16 with
http://storage.googleapis.com/shaka-demo-assets/_bugs/safari-10-mse-abort/index.html
2023-02-28 21:12:05 +01:00
Álvaro Velad Galván 8818a026d6 fix: Reject TS content on Edge (#5043)
Fixes https://github.com/shaka-project/shaka-player/issues/4955
2023-02-28 20:16:16 +01:00
Álvaro Velad Galván 6a48cfe64d fix: Fix MediaCapabilities polyfill on Hisense (#4927)
fixes https://github.com/shaka-project/shaka-player/issues/4925
2023-01-23 21:50:35 +01:00
Álvaro Velad Galván 61613cf0ee feat: Config to require a minimum HDCP version (#4883)
https://github.com/WICG/hdcp-detection/blob/main/explainer.md

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2023-01-11 21:04:16 +01:00
Julian Domingo 36db83dc99 fix(cast): Added existence checks for MediaDecodingConfig.{audio|video} in decodingInfo(). (#4796)
See https://github.com/shaka-project/shaka-player/issues/4790.

To be honest, I'm failing to understand how a `TypeError` can happen
here (this is occurring in a Casted Apple Music, non-`AES-128` stream,
so `EME`), since:
1. The problematic code lines aren't reachable unless
`MediaDecodingConfig.keySystemConfiguration` is set.
2. `MediaDecodingConfig.keySystemConfiguration` is only set if
`drmInfos` are provided:

https://github.com/shaka-project/shaka-player/blob/68f10a1969b3ae639cd58b76b30b223cd4a08a5c/lib/util/stream_utils.js#L659-L666

during manifest parsing (showing HLS for example):

https://github.com/shaka-project/shaka-player/blob/68f10a1969b3ae639cd58b76b30b223cd4a08a5c/lib/hls/hls_parser.js#L1003-L1016

Regardless, `requestMediaKeySystemAccess()` will never report a variant
is `supported` if `contentType` is null/empty string (as per
https://w3c.github.io/encrypted-media/#get-supported-capabilities-for-audio-video-type).
So the polyfill implementation behaves the same as before this change.
2022-12-07 10:02:13 -08:00
Zhenghang Chen ad6c08561d perf: Caching mediaSource support for browser engine (#4778)
Caches the results of MediaSource.isTypeSupported, which is slow on some platforms, to reduce the
number of calls needed. This is especially helpful on manifests with many similar variants (multiple languages, etc).
Data collected from 2 months of practical testing shows that this helps reduce the start lag by 40% on Chromecast, 15% on WebOS, and 12% on Tizen.
2022-12-05 19:47:13 -08:00
Julian Domingo 5d6f56adf3 fix(cast): Use cast platform APIs in MediaCapabilties polyfill (#4727)
See https://github.com/shaka-project/shaka-player/issues/4726 for more
context.

This allows Cast devices to properly filter stream variants with a
resolution surpassing that of the device's capabilities.

We place the fix in the `MediaCapabilities` polyfill since it's intended
to be the right way to check for anything related to platform support.

HDR support checks will require `eotf=smpte2048`, as indicated in
https://github.com/shaka-project/shaka-player/issues/2813#issue-684874730.
Specifically, a `{hev|hvc}1.2` profile is only an *indication* of an HDR
transfer function, but *may* be a non-HDR 10-bit color stream.

In Cast, the platform can distinguish between the two by explicitly
providing the transfer function; it uses `smpte2048` (`"PQ"`) because
this is the "basis of HDR video formats..."
(https://en.wikipedia.org/wiki/Perceptual_quantizer).
2022-12-01 09:18:24 -08:00
Dave Nicholas 884c4ca4f8 feat: Caching and other efficiency improvements for mcap polyfill (#4708)
This PR caches the result of `requestMediaKeySystemAccess` saving time
on subsequent calls.

It also makes the calls to `decodingInfo` synchronous. The reason for
this, is the result of testing on multiple devices that the behaviour of
`requestMediaKeySystemAccess` appears to be synchronous, making this
synchronous can save over a second on older TVs.

Closes #4574
2022-11-18 09:34:33 -08:00
Joey Parrish 75ef9752a4 fix: Polyfill missing AbortController on Tizen (#4707)
We started using AbortController in HlsParser in 777c27ee, but that
change was made while the Tizen TV in our lab was offline. This restores
functionality to Tizen.

This polyfill uses getters, a feature of ES6 that the compiler won't
transpile into ES3, so this also changes the output language to ES5.
This should not be an issue, since ES5 has been well supported in all
browsers since IE10.
2022-11-15 09:16:25 +01:00
Joey Parrish b06fd6ad27 fix: Fix compiler error on static use of "this" (#4699)
An internal build system failed to compile v4.3.0 due to the use of
static "this". This change fixes it.

Unfortunately, we are already running the latest public compiler
release, so there is no way we could have caught this on GitHub.
2022-11-11 16:31:50 -08:00
Matthias 6191d5894d fix: Force using mcap polyfill on EOS browsers (#4630)
The MCap API on the EOS set-top boxes is rather buggy thus we're relying
on the polyfill instead.
2022-10-28 13:29:15 -07:00
Julian Domingo 65903aa27b fix: Resolve load failures for TS-based content on Android-based Cast devices (#4569). (#4570)
See https://github.com/shaka-project/shaka-player/issues/4569 for more
context.

This affects any Chromecast model which contains the substring `Android`
in their userAgent. For TS content, this causes Shaka to incorrectly
filter all stream variants leaving nothing for the player to select for
playback (resulting in a `4032` error):
https://github.com/shaka-project/shaka-player/blob/757b34e5959f14c9a5b5aed173cc99d98a794a40/lib/util/stream_utils.js#L484-L491.
2022-10-14 15:16:12 -07:00
Martin Stark 7166f0c1d0 feat: enable uninstalling PatchedMediaKeysApple (#4471)
Close #4469
2022-09-23 09:52:42 +02:00
Álvaro Velad Galván eb2aed825e fix: Fix MediaCapabilities polyfill on Tizen and WebOS (#4396)
Closes #4383
Closes #4357
2022-08-10 10:21:40 -07:00
Álvaro Velad Galván 5441f932fd feat: Add support for Modern EME and legacy Apple Media Keys for FairPlay (#4309) 2022-06-29 07:13:53 +02:00
bcupac 0335b2af2e fix: Fix MediaCapabilities polyfill on Playstation 4 (#4320)
Add Playstation 5 detection to the Media Capabilities Polyfill install method.

Fixes #4320
2022-06-28 07:23:45 +02:00
Álvaro Velad Galván 556111143d fix: Fix getVideoPlaybackQuality in WebOS 3 (#4316)
It seems that webkitDroppedFrameCount is not included in the prototype but it is included in the video element itself, that's why it fails in WebOS 3.

Closes https://github.com/shaka-project/shaka-player/issues/4313
2022-06-25 20:54:36 -07:00
Álvaro Velad Galván 11321d8f26 feat: only polyfill MCap for non Android-based Cast devices. (#4170)
Related to https://github.com/shaka-project/shaka-player/issues/4164#issuecomment-1110143441
2022-04-28 11:02:49 -07:00
Joey Parrish ead344fe1f chore: Drop MS EME polyfill (#4123)
The MS EME polyfill has been unused since v3.1 and removal of IE support, and isn't needed for Edge or Xbox One support.

Closes #4113
2022-04-12 21:15:14 -07:00
Álvaro Velad Galván 8bb70449d3 feat!: Remove support for Safari 12 and iOS 12 (#4112)
1. Remove support for Safari 12
2. Support modern EME in Safari 13
3. Remove EME Apple polyfill
4. Update documentation
2022-04-11 16:17:51 -07:00
Álvaro Velad Galván 169943f668 chore: remove mathround polyfill (used in IE) (#4114) 2022-04-11 13:15:04 -07:00
Álvaro Velad Galván 57c73241a0 fix(performance): Eliminate use of ES6 generators (#4092)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210

Co-authored-by: @joeyparrish

Issue #4062
2022-04-04 10:58:16 -07:00
theodab 8a3bed710c feat(HLS): Re-add TS support to Safari (#4097)
It appears that the problems we previously had with TS content
on Safari have been fixed. We no longer need the workaround where
we transmuxed TS on that platform.
2022-04-01 20:32:12 -07:00