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.
A previous PR, #5950, added support for variants that contain multiple
different codecs.
It was supposed to also add support for variants with multiple
mimeTypes, but that part didn't work correctly. This reworks a lot of
#5950 and #6047, to change how they handle such complicated variants.
This has the side-effect of allowing the stream utils to differentiate
between content that has multiple codecs because of type changes, and
content that has multiple codecs because of being muxed video+audio.
Fixes#6010
---------
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
When constructing the MediaDecodingConfigurations to query media capabilities in `stream_utils.js`, the spelling of "fLaC" should not change to "flac" on Safari. This is because on Safari the query will return `supported: false` for "flac" but `supported: true` for "fLaC".
This change allows manifests with "fLaC" codecs to work properly on Safari when using MSE / Managed Media Source.
Fixes#6249