Commit Graph

290 Commits

Author SHA1 Message Date
Álvaro Velad Galván 2ea2b5ec66 chore: Use shaka.drm.DrmUtils.is*KeySystem in shaka.polyfill.EncryptionSchemeUtils (#9591) 2026-01-22 13:18:56 +01:00
Andy(김규회) 05b09728c7 perf: Use Map.getOrInsert/getOrInsertComputed native methods (#9546)
Added polyfills for `Map.getOrInsert()` and
`Map.getOrInsertComputed()` from the TC39 upsert proposal and refactor
the codebase to use them.
These methods replace the common "check if key exists, then set default"
pattern with a single atomic operation. This improves code readability
and eliminates redundant map lookups throughout the player.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-01-13 10:57:25 +01:00
Joey Parrish 37b952db9f fix(DRM): Fix cache keys to include encryption scheme (#9392)
When caching a result from EME, it's important to consider the
encryption scheme, which can affect the success or failure of a query.
2025-11-14 15:12:43 -08:00
Álvaro Velad Galván d776ca6005 chore: Remove old IE code (#9324) 2025-10-31 12:56:12 +01:00
Wojciech Tyczyński f1768a5f84 chore: Remove JSDoc for empty constructors (#8955)
We don't need this anymore with `exemptEmptyConstructors` config added
in #8901
2025-08-05 13:06:00 +02:00
Joey Parrish ddda658d39 chore: Update to the latest Closure Compiler (#8925)
- Bump to Java 21 to support the new compiler.
 - Removes externs now included in the compiler.
 - Removes compiler flag no longer supported.
- Adds onkeystatuseschange to MediaKeySession polyfills (now in compiler
externs).
- This new compiler now triggers a warning in the Closure Library, which
will get fixed in a follow-up to update the library.
2025-07-29 10:36:40 -07:00
Álvaro Velad Galván 83604c3037 chore: Move eme-encryption-scheme-polyfill to the Shaka Player repo (#8818)
We want to apply several optimizations to MCap and Shaka management,
which makes everything easier if the code is in this repo.
2025-07-01 13:24:28 +02:00
Wojciech Tyczyński 970d7756ea feat: Add Device API (#8210)
The goal is to simplify and abstract feature logic detection. Currently
lots of places depend on various calls to `shaka.util.Platform` and
mainteinance of this is hard & not easy to read.

By introducing device API ideally rest of the player logic would look
into device features instead of directly checking platform. Additionally
we can more easily cache needed values, so we won't have to parse user
agent several times anymore.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-06-02 13:46:40 +02:00
Wojciech Tyczyński b2595ced9e fix(WebOS): Do not throw error during parsing ID3 (#8623)
`TypedArray.prototype.indexOf` is available since Chrome 45, which means
it's not implemented on WebOS 3 (using Chromium 38). As we extensively
use this method in `Id3Utils` it leads to fatal errors on this platform
whenever we encounter ID3 tags.
For completeness and to prevent errors in the future, I also added
implementations of connected methods: `lastIndexOf` & `includes`.
2025-05-21 10:55:51 +02:00
Vincent Derks 394ed7bed7 fix: Fix garbage-collection issue in safari on mediaCapabilities polyfill (#8613)
Fixes https://github.com/shaka-project/shaka-player/issues/8607
Fixes https://github.com/shaka-project/shaka-player/issues/8590
2025-05-19 13:30:06 +02:00
Álvaro Velad Galván fb120f89c2 fix: Avoid installing/uninstalling PatchedMediaKeysApple polyfill twice (#8593) 2025-05-13 06:31:11 +02:00
Álvaro Velad Galván d15e21cb91 fix: Fix MediaCapabilities polyfill on Vizio (#8542)
Fixes: https://github.com/shaka-project/shaka-player/issues/8537
2025-05-05 17:36:12 +02:00
Álvaro Velad Galván e3d8140094 perf: Remove extendedType when checking isTypeSupported on Tizen (#8507)
This is no longer necessary since we dynamically detect the resolution
and this allows us to cache isTypeSupported calls with less dispersion.
2025-04-24 13:50:55 +02: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 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 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
Wojciech Tyczyński d03eb6ed02 chore: Simplify Apple detection (#8035)
Our Apple device detection misdetects any Webkit-based STB as Apple, due
to looking only at vendor property. To mitigate it, we were excluding
another user agents, but maintenance of this is problematic.
This PR tries to change direction - an Apple device right now is a
device with Apple vendor AND with characteristics of MacOS or iOS.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-02-07 13:28:27 +01:00
Álvaro Velad Galván 148c4011e6 chore: Stop using "Object" in cache annotations (#7938)
Related to https://github.com/shaka-project/shaka-player/issues/1672
2025-01-24 11:36:56 +01:00
Wojciech Tyczyński 6e55a3b21b build: Forbid using dot in generic types (#7904)
Fixes #2643

Happy reviewing!
2025-01-20 09:39:51 +01:00
Wojciech Tyczyński 510962fc38 build: Upgrade ESLint to v9 and migrate config (#7887)
Migrates old config file to new flat config recommended by ESLint now.
Removes jsdoc rules, as they are not available anymore in ESLint.
Instead, if we want to have them, we should use `eslint-jsdoc-plugin`.
2025-01-16 10:58:03 +01:00
Álvaro Velad Galván a88f16f5d6 test: Enable disabled test for Chromecast (#7820) 2025-01-03 11:27:49 +01:00
Álvaro Velad Galván 179ccc61b8 chore: Move DrmEngine and DrmUtils to drm namespace (#7788) 2024-12-20 13:10:29 +01:00
Álvaro Velad Galván bc0b9f2ab4 fix(Cast): Incorrect detection of MediaCapabilities on Linux Chromecast (#7628)
Fixes https://github.com/shaka-project/shaka-player/issues/5776
2024-11-20 09:33:36 +01:00
Joey Parrish f9647083ad fix: Fix cast support for HLG HDR (#7632)
Also document what is recognized, how, and why those strings are used.
2024-11-19 15:13:11 -08:00
Álvaro Velad Galván 3a83e7693f feat: Add new error code for missing EME support (#7596)
Close https://github.com/shaka-project/shaka-player/issues/4495
2024-11-14 18:41:08 +01:00
Iragne 2b2df4b2e2 fix: Install polyfills for Comcast X1 devices (#7529)
Close https://github.com/shaka-project/shaka-player/issues/7522
2024-11-04 15:11:50 +01:00
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