Pick a multi DRM asset, set `preferredKeySystems` to prefer PlayReady
over Widevine and run on a device that does not support PlayReady (eg;
Chrome).
A `REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE` is thrown.
This is due to the logic in `getDecodingInfosForVariants` where we bail
out on probing other decodingInfos when we found a prefered one, but we
didn't check whether it was supported or not. As a result, Widevine was
never checked and PlayReady was left marked as unsupported.
`queryMediaKeys()` was able to work both with variants and key system
configs. The latter option was needed only for `initForRemoval()`
method. By removing it we are able to make the logic more easy to
follow.
Additionally, compiled build is now 2 KB smaller.
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>
This changes the `drm.advanced.videoRobustness` and `audioRobustness`
config options from a string to an array of strings. Internally, in the
drm engine, this gets expanded into an array of `DrmInfos` which have
those values as strings.
Best way to review this change is with whitespace turned off in the diff
options.
---------
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
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
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
If any segment gets evicted in live scenario, `segmentIndex.get(0)` will return `null`. Due to that, image tracks have `tilesLayout` set to `null` if we call `player.getImageTracks()` after segments have been evicted.
Additionally to main fix, I've replaced all other appearances of `segmentIndex.get(0)` with `segmentIndex.earliestReference()` to prevent similar bugs.
On Xbox One, Media Source claims it's not able to play Dolby Vision codecs. However, when it's created using their AVC/HEVC equivalent, it plays fine DV content.
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`.
This makes it easier to debug hardware resolution issues through the
support page, which can now show hardware resolution. To show the
support page on Chromecast devices, use chromecast-webdriver-cli.