Commit Graph

238 Commits

Author SHA1 Message Date
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
Álvaro Velad Galván 400575498f fix(cmcd): Fix Symbol usage in CMCD on Xbox One (#4073)
Close #4072

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-03-29 16:04:26 -07:00
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -08:00
Vincent Valot 6d76a135e5 feat: add modern EME support for FairPlay (#3776)
Add support for HLS com.apple.streamingkeydelivery through MSE/EME implementation.

Close #3346

## Tests
Tested on:
- Mac 11.6 Safari 15.2
- iOS 15.2 Safari 15.2
- Mac 11.6 Chrome 96 (for potential regressions on Widevine keySystem)

| Mode | DRM API | TS | CMAF (mono-key and multi-keys)
|---|---|---|---|
| file | EME |   |   |
| file | Legacy-prefixed |    |    |
| media-source | EME | **mux-js**: `encrypted` never fired<br />**real MSE**: `encrypted` event received, but with incorrect `sinf` initData (*1)  |   |
| media-source | Legacy-prefixed | **mux-js**: `webkitneedkey` never fired<br/>**real MSE**: TBD  | 🔴 fails to append media segment to SourceBuffer (init segment ok) `(video:4) – "failed fetch and append: code=3015"` |

## Support table 
| Mode | DRM API | TS | CMAF (mono-key and multi-keys)
|---|---|---|---|
| file | EME |   |   |
| file | Legacy-prefixed |    |    |
| media-source | EME | 🚫 `4040: HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED`  |   |
| media-source | Legacy-prefixed | 🚫 `4041: HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED`  |🚫 `4041: HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED` |

⚠️ Use EME APIs with multi-keys CMAF makes the video stalling with the audio continuing alone after a short time (~3 minutes in the stream, could be shorter, could be longer). Didn't find an explanation to that yet. I've observed the same behaviour with hls.js code so I don't think this is a player issue.
2022-02-07 11:17:22 -08:00
Joey Parrish 0201f2b760 fix: Fix MediaCapabilities polyfill on Safari
Fixes #3696
Fixes #3530

Change-Id: I2f2e248c9001e10013eb4b03af6b9ef49f28dc6c
2022-01-11 04:02:38 +00:00
Joey Parrish dfc44cbca6 fix: Fix usage of Shaka without polyfills
Revert "fix: Work around override of MediaCapabilities polyfill in Apple browsers (#3668)"

This reverts commit 31c0cd4b8c.

Fixes #3843 (usage of Shaka without polyfills)
Re-opens #3530 (MediaCapabilities polyfill not working on Safari)

Change-Id: Ib5aff1b38759e1a39200332f3f07d3d6bd3bd2e1
2022-01-11 04:02:38 +00:00
Casey Occhialini 1d54965bdc Update media capability polyfill to account for Playstation 5 (#3808)
Add Playstation 5 detection to the Media Capabilities Polyfill install method.

Fixes #3582

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2021-12-16 12:54:02 -08:00
Theodore Abshire dd3748d599 fix: Enforce string-format of event data keys.
Previously, many events were being defined with a data dictionary
that used variable-type keys (e.g. {key: value}). This worked fine
in uncompiled mode, but in compiled mode it lead to those properties
being obfuscated.
This changes the FakeEvent constructor to take a map rather than an
object, so the compiler will force the keys to be strings.

Closes #3710

Change-Id: I67b1a391540a5ee21f0aaf940ae054d26f4c10a4
2021-10-25 12:40:32 -07:00
david-hm-morgan 13aafcfd7e fix: Fix vp09 playback on webOS (#3566)
Skip the vp09 polyfill for isTypeSupported on this platform.
2021-10-18 13:51:54 -07:00
Álvaro Velad Galván 31c0cd4b8c fix: Work around override of MediaCapabilities polyfill in Apple browsers (#3668)
See also #3696

Closes #3530
2021-10-12 10:59:06 -07:00
Álvaro Velad Galván a72adca9fd feat: Add randomUUID polyfill (#3669)
Related to: #3662
2021-09-29 15:09:05 -07:00
vodlogic 52f18df21b chore: Add @export annotations to polyfill install methods (#3660)
This change allows polyfills to be installed individually e.g. shaka.polyfill.MediaCapabilities.install() instead of shaka.polyfill.installAll()

Related to #2625
2021-09-23 14:27:50 -07:00
Álvaro Velad Galván 4dce1e0ba5 Fix: Always polyfill MediaCapabilities for Apple browsers (#3588) 2021-08-20 17:21:35 -07:00
Álvaro Velad Galván ef506ac647 Fix: Add Support to iOS 12 in MediaCapabilities polyfill (#3573)
In iOS, there is no support for MediaSource, and we should have  'file' as the type of the MediaiDecodingConfig, to check whether the content is supported or not. We should only require MediaSource support in the polyfill when the type of MediaiDecodingConfig is 'media-source'. 
Issue: #3530 .
2021-08-16 07:16:21 -07:00
Álvaro Velad Galván c07d1a3e09 fix: Add support to file type in MediaCapabilities polyfill (#3569)
Issue: #3530
2021-08-10 10:04:24 -07:00
Joey Parrish b185b3c9ea fix: Make ARIA polyfill more robust
All the attributes listed in the polyfill already begin with "aria".
However, to add extra protection against the possibility of XSS
attacks through one of the polyfill's internal methods, this enforces
"aria-" at the beginning of the snake-case attribute name, even if
somehow "aria" were missing from the input JavaScript attribute name.

This change is based on the outcome of an internal security review.

Change-Id: Iec8a9cbd5f88fdf4b87da3e5cd058c4ffb69c3ff
2021-07-20 16:59:17 +00:00
Joey Parrish 6757d238d0 fix: Fix compilation error with strict constness
The MediaCapabilities polyfill caused compiler errors in stricter
environments, in which navigator.mediaCapabilities was marked as
const.  This suppresses constness errors from the compiler in the
install method of the polyfill.

Change-Id: Idb47a473335c886a2a7b3c77b84ce8f51fce4114
2021-07-20 00:19:31 +00:00
Joey Parrish de77787219 fix: Fix mediaCapabilities polyfill on Chromecast
Chromecast firmware now includes limited support for
mediaCapabilities, but we still need to install the polyfill for now.
The platform will let us overwrite the decodingInfo method, but not
the mediaCapabilities object itself.  This fixes the polyfill to
handle this situation.

Change-Id: Ia770457ad8465ec1caf4420ef757303adbe55ce5
2021-07-09 03:41:41 +00:00
Theodore Abshire cf2fb903cb feat(ARIA): Add polyfill for ARIAMixin.
The ARIAMixin interface mixin lets users apply ARIA attributes to
DOM elements without having to rely on setAttribute and getAttribute.
It is one of our goals to switch to using that interface.
Unfortunately, it is not implemented on Firefox, so a polyfill is
necessary for that platform, before we can start using it.

Issue #3378

Change-Id: Ia878900d75c7c2c04613360baacb4524774ac746
2021-07-01 15:43:37 -07:00
Michelle Zhuo bf0644aa4a feat(MediaCap): Patch VP9 codec
MediaCapabilities supports 'vp09...' codecs, but not 'vp9'. Translate
vp9 codec strings into 'vp09...', to allow such content to play with
mediaCapabilities enabled.

Change-Id: Iff7ddae379efb8a9f0766c89a62b85a325f81e93
2021-04-29 20:27:09 +00:00
Michelle Zhuo e592d4888e feat(MediaCap): Always polyfill MediaCap for Chromecast
Since we got some unexpected decodingInfo results from MediaCapabilities
on Chromecast, we should fall back to MediaSource.isTypeSupported() on
Chromecast.

Issue #1391

Change-Id: I4947ec78624e98c7039df64ad691e14ece2588e0
2021-04-29 18:04:06 +00:00
Michelle Zhuo 95ba28b5af refactor: Remove IE 11 support
Issue #2339

Change-Id: I80ffa7b04f7afd943aa0f881d2a494dd35def732
2021-04-29 17:47:07 +00:00
Álvaro Velad Galván 463b1b6886 Remove support for IE 11 (#3309)
Issue #2339
2021-04-16 13:59:35 -07:00
Michelle Zhuo b63a64e4ba feat(MediaCap): Use mediaKeySystemAccess from decodingInfo in DrmEngine
In DrmEngine, previously we created MediaKeySystemConfiguration for the
variants, and called navigator.requestMediaKeySystemAccess() to get the
mediaKeySystemAccess, and set up MediaKeys.

Now we can use the mediaKeySystemAccess from the decodingInfo results of
the variants directly to set up MediaKeys.

Issue #1391

Change-Id: Id93a5e2fed7f6827317ae11644967185fc0cffbd
2021-04-07 19:32:47 +00:00
Michelle Zhuo aca343bf2c feat(MediaCap): get mediaKeySystemAccess via decodingInfo
In StreamUtils, add a MediaCapabilitiesKeySystemConfiguration
for each key system for the encrypted variant passed to the
decodingInfo API, to get the mediaKeySystemAccess as a part of
the decodingInfo results.

We create a list of mediaDecodingConfigurations for each variant,
and call decodingInfo() with each mediaDecodingConfiguration to
get the mediaKeySystemAccess.

Eventually, we'll use the mediaKeySystemAccess from the
decodingInfo results to replace the call of
navigator.requestMediaKeySystemAccess() in DrmEngine. That will be
in the next CL.

Also, adding MediaCapabilties polyfill with mediaKeysSystemAccess.

Issue #1391

Change-Id: Ied4a27dd8a1ade43209bcf07f21f0c9b31c2693c
2021-03-30 20:26:46 +00:00
Michelle Zhuo f4c6063b82 feat(MediaCap): Add polyfill for MediaCapabilities
If navigator.mediaCapabilties is not supported by the browser, use
MediaSource.isTypeSupported to check if the stream is supported.

Issue #1391

Change-Id: Iee0c7e339add2a07028ed14a03df14e4d36a203e
2021-03-12 13:44:53 -08:00