Commit Graph

173 Commits

Author SHA1 Message Date
theodab 24e32559bf feat(DASH): Handle mixed-codec variants. (#5950)
With the addition of the changeType API for MediaSource, it is theoretically possible for a variant to change between multiple codecs for a given buffer, over the course of playback.
This adds support for the DASH player to stitch together periods which have such multi-codec variants, but only as a last resort. For example, if one period only has audio in aac, and another period only has opus audio, the player will now stitch those periods together as one, but if there is a throughline that does not involve changing codecs it will go for that instead.

Closes #5961
2023-12-01 00:37:32 -08:00
Álvaro Velad Galván c830a99041 fix: Fix selectAudioLanguage using channelsCount param (#5875) 2023-11-13 09:10:32 +01:00
Álvaro Velad Galván d6aab6befa fix: Fix missing audio streams (#5869)
Fixes https://github.com/shaka-project/shaka-player/issues/5858
2023-11-13 09:10:12 +01:00
Álvaro Velad Galván 801131f84c feat(HLS): Add support for mjpg I-Frames playlist (#5856)
It also adds support for rendering downloaded thumbnails.
2023-11-08 03:29:09 +01:00
Álvaro Velad Galván 51edeaefa0 fix: Fix variant filtering by preferredAudioChannelCount (#5859)
Fixes https://github.com/shaka-project/shaka-player/issues/5858
2023-11-06 11:49:20 +01:00
Álvaro Velad Galván 508e5cfbba feat(DASH): Add initial support for "urn:mpeg:dash:ssr:2023" (#5762) 2023-11-03 14:57:15 +01:00
Álvaro Velad Galván 5aa3597074 fix: Fix incompatible codec is selected in Windows Edge for Widevine (#5831)
Fixes https://github.com/shaka-project/shaka-player/issues/4242
2023-10-30 16:23:13 +01:00
Álvaro Velad Galván 8ff204d49d fix: Fix chooseCodecsAndFilterManifest for similar frameRate (#5817) 2023-10-27 09:08:07 +02:00
Álvaro Velad Galván 81fc82b6b2 feat(HLS): Add support for REQ-VIDEO-LAYOUT (#5809)
Also add preferredVideoLayout config
2023-10-26 09:25:45 +02:00
Álvaro Velad Galván 51870e9d7c fix: Fix chooseCodecsAndFilterManifest for some HLS manifest (#5800) 2023-10-24 18:16:08 +02:00
Ivan 170a40c308 perf(Xbox): drop incompatible variants for XBOX early (#5777)
This change:

- drops incompatible variants for XBOX before parsing codes and checking them against media capabilities API
- avoids redeclaring variables each time in the loop

Co-authored-by: Ivan Kohut <ivan.kohut@lamin.ar>
2023-10-18 13:04:38 -07:00
Dave Nicholas 0078137d1b feat: Enable codec switching (#5470)
Closes: https://github.com/shaka-project/shaka-player/issues/1528
Closes: https://github.com/shaka-project/shaka-player/issues/1567
Closes: https://github.com/shaka-project/shaka-player/issues/4379
Closes: https://github.com/shaka-project/shaka-player/issues/5306

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2023-10-04 08:37:14 +02:00
Wojciech Tyczyński d021d6f932 fix: fix preferred track selection on Safari (#5601)
Preferred track selection was implemented differently for MSE and native
playback. In fact, native playback even had different implementations
for audio and text. It leads to inconsistencies during track selection,
i.e. if track language contains locale, but language preference not, on
MSE we're looking for closest locale and on src= we're making direct
string comparison which leads to different results.
To unify that, both MSE and native will now use
`StreamUtils.filterStreamsByLanguageAndRole()` to find matching track.
This method is designed to use on `shaka.extern.Stream` but luckily it
uses the very same fields as defined in `shaka.extern.Track` so we can
use it without major changes.
Moreover, using this more robust method also allows us to get rid of
double-selection workaround used so far. Observe that we were first
selecting track without preferred role and then with preferred role.
2023-09-05 08:24:49 -07:00
Wojciech Tyczyński 8cd3e2dd26 fix: Default language to 'und' for native tracks (#5464)
Set default language to `und` for native audio/text tracks if missing.
2023-08-15 17:49:04 +02:00
Wojciech Tyczyński 4f1a1196a9 fix: add MIME type for HTML5 tracks (#5452) 2023-08-15 17:38:30 +02:00
lonebyte ccc3d2fb71 fix: Support fLaC and Opus codec strings in HLS (#5454)
Fixes: #5453
2023-08-15 17:35:05 +02:00
Wojciech Tyczyński f53349fc93 feat: Add originalLanguage to the Track structure (#5409)
Shaka in most of places normalizes tracks' language code to be compliant with ISO 639-1 when possible. However, it does not do that all the time (i.e. normalization is missing in MSS parser) and there is no way to get value that has been explicitly set in a manifest. Moreover, documentation is misleading, as it claims that value is taken directly from a manifest.
Normalization should take place, specifically to easify PeriodCombiner algorithm and also to not break existing applications.
However, original value can be desired for some implementations.
This PR introduces new field to get original language value from the manifest.
2023-07-18 02:09:17 -07:00
Wojciech Tyczyński 6d75d89fbb feat(DRM): use preferredKeySystems to reduce requestMediaKeySystemAccess() calls (#5391)
Propagate `preferredKeySystems` config to `getDecodingInfosForVariants()` method.
By doing that, shaka can only ask for `MediaKeySystemAccess` objects that will be used during playback.

If any preferred key system is available, player will stop requesting for MKSA.
If none of preferred key systems is available, player will try to get MKSA for any existing configuration, as usual.
2023-07-08 04:36:32 -07:00
theodab 2f511a2930 feat: Add preferredVideoHdrLevel config. (#5370)
This configuration value allows the manifest variants to be filtered based on the HDR level of their video stream.
By default this is set to an auto-detect setting, which chooses PQ or SDR based on the device's detected capabilities.
2023-06-29 03:16:31 -07:00
Álvaro Velad Galván 1ad75ec8b7 fix: Populate HDR correctly (#5369) 2023-06-29 09:45:01 +02:00
theodab 654a0281d9 feat(DASH): Expose accessibility purpose in track (#5216)
Closes #5211
2023-05-08 17:13:06 -07:00
/zɒ̃ge/ fdc5cb165d fix: Fix temporarily disable streams on network error (#5057)
Relates to #4189
Fixes #5054 
Fixes #5055
Fixes #5150
2023-04-18 19:22:00 +02:00
Fernando Neira 3543e579c5 feat(utils): Export shaka.util.StreamUtils.meetsRestrictions (#5100)
Closes https://github.com/shaka-project/shaka-player/issues/5098
2023-03-17 22:15:08 +01:00
Álvaro Velad Galván 62eea57660 chore: Fix typos in logs (#5097) 2023-03-16 13:09:02 +01:00
Álvaro Velad Galván 7439a264d6 fix(MCap): Remove robustness when robustness value is default (#4953)
Fixes https://github.com/shaka-project/shaka-player/issues/4659
2023-01-31 18:21:28 +01:00
YuChao Liang e351395c4a fix: Fix legacy codec support by rewriting codec metadata (#4858)
This fixes legacy codec support by rewriting the codec metadata in the
Stream objects. After capability checking, the converted codec
information will be used.

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2023-01-05 13:41:11 -08:00
theodab 806a9a81c4 fix: Manually order key for decodingInfo cache (#4795) 2022-12-07 11:39:11 -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
theodab b7781f0446 feat: Cache mediaCapabilities.decodingInfo results (#4789)
Issue #4775
2022-12-05 18:12:21 -08:00
Álvaro Velad Galván c3ff8e5e5f fix(HLS): Fix support legacy AVC1 codec used in HLS (#4716) 2022-11-18 16:33:06 -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
Álvaro Velad Galván 8475214bc4 fix: Filter unsupported H.264 streams in Xbox (#4493) 2022-09-19 19:59:50 +02:00
Joey Parrish b6ab769762 fix: Fix VP9 codec checks on Mac Firefox (#4391)
Tests for VP9 codec checks were failing on Firefox on our M1 Mac.  This
addresses the issue by changing some default values that get used in a testing
environment, and another default value that is used in production.
2022-08-09 08:26:40 +02:00
Casey Occhialini 713f461c62 fix: Populate track's spatialAudio property (#4291)
Fixes issue #4290 where `spatialAudio` flag is not being set on variant tracks.

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2022-06-13 16:19:48 -07:00
Gaetan Hervouet b757a81902 fix: Fix PERIOD_FLATTENING_FAILED error when periods have different base sample types (#4206)
Closes #4202
2022-05-17 09:46:43 -07:00
Albert Daurell b57279d39c feat: Temporarily disable the active variant from NETWORK HTTP_ERROR (#4189)
When a `NETWORK HTTP_ERROR` is thrown, we'll temporarily disable the variant for `shaka.extern.Restrictions.maxDisabledTime` seconds (default will be 30 seconds).

Closes #4121
Closes #1542
2022-05-05 09:02:32 -07:00
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -08:00
Álvaro Velad Galván dfb369935b fix: Fix misdetection of HEVC support on MS Edge (#3897)
The proposed solution checks that all variants, apart from being checked in mediaCapabilities.decodingInfo, are also checked with MediaSource.isTypeSupported

There are some browser implementations that return a true mediaCapabilities.decodingInfo for unknown mimetypes and codecs and that can cause an application-level problem. For example, EDGE on Windows 10 returns true to HEVC even if you don't have the extension installed to support HEVC, instead MediaSource.isTypeSupported does take this into account

Fixes: #3860
2022-01-25 10:20:42 -08:00
Álvaro Velad Galván 74c491d2e0 feat: Add separate audio and video MIME types to Track API (#3892)
Fixes: #3888
2022-01-24 15:28:17 -08:00
Álvaro Velad Galván 087a9b489b fix(image): Fix thumbnails issues (#3858) 2022-01-13 14:37:28 -08:00
Álvaro Velad Galván 9f3fb46d37 feat: Allow WebP and AVIF image streams (#3856)
Fixes: #3845
2022-01-13 14:07:35 -08: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
Theodore Abshire 264c842496 fix(image): Fix HLS image track issues
This makes the HLS parser honor more attributes for image tracks.
It also makes some changes to player.getImageTracks, so that the
returned track shows the size of a single thumbnail rather than the
entire sheet.

Closes #3840

Change-Id: I2ae096f455864201e08a85e29f0f02a3e06eb07f
2022-01-11 03:41:12 +00:00
theRealRobG 1e7f2f3dc8 Pass HDR information when getting decoding info from media capabilities (#3730)
Fixes #3729

If the video variant stream contains information about `hdr`, then we now use that to provide a value for `transferFunction`, when constructing the [`VideoConfiguration`](https://w3c.github.io/media-capabilities/#videoconfiguration) object used to get decoding info from media capabilities API.

The following applies:
```js
switch (video.hdr) {
  case 'SDR':
    mediaDecodingConfig.video.transferFunction = 'srgb';
    break;
  case 'PQ':
    mediaDecodingConfig.video.transferFunction = 'pq';
    break;
  case 'HLG':
    mediaDecodingConfig.video.transferFunction = 'hlg';
    break;
}
```
2021-11-03 14:40:41 -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 233c2bf4d8 Fix: Add support to file type in mediaCapabilities implementation (#3570)
If it's srcEquals, the 'type' element of the input object when querying mediaCapabilities should be 'file'. Otherwise it should be 'media-source' .
Issue: #3530
2021-08-15 23:41:19 -07:00
Álvaro Velad Galván 0579ee7779 feat(CodecPreference): Improve preferredVideoCodecs & preferredAudioCodecs (#3424)
Currently a full chain comparison is done, but in video and audio codecs, you may want H.265/VP9 with no profile preference, with this change it is possible to do this.
Examples:
'hvc1' instead of 'hvc1.1.2.L123.80' and 'hvc1.1.2.L153.80'
'vp09' instead of 'vp09.00.40.08.00.02.02.02.00'
2021-05-26 10:38:26 -07:00
Michelle Zhuo 9709086e98 refactor(MediaCap): Remove MediaCapabilities config
Remove "useMediaCapabilities" configuration in the code base.

Issue #1391

Change-Id: I5fc74e31666840828e9dc04a5733db3eaed0d21a
2021-05-21 20:39:06 +00:00
Michelle Zhuo 9a706ef90e feat(CodecPreference): Add preferred codecs config
Adding the "preferredVideoCodecs" and "preferredAudioCodecs"
configuration, so that the application can set their own preferences
when choosing a codec.

Issue: #2179
Change-Id: Ib56aec10613dda9b7dce8e465c5f1d81540c34fd
2021-05-21 18:59:04 +00:00
Álvaro Velad Galván a096bc1452 fix:Filter unsupported H.264 streams in Xbox (#3411) 2021-05-17 14:01:11 -07:00