Commit Graph

256 Commits

Author SHA1 Message Date
Álvaro Velad Galván c866d7b467 feat(HLS): Allow disable streams when the media playlist fails (#6807) 2024-06-13 09:32:09 +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 d5b1863157 fix: Fix green screen issue on Edge with mixed content (#6719)
On Edge, to properly play mixed content, we need to insert init segment twice for clear part - once as encrypted, and immediately again as clear. Otherwise we may encounter green screen and errors from video decoder.

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
Co-authored-by: Nick Michael <nick-michael@users.noreply.github.com>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
2024-06-07 13:06:13 -07:00
Álvaro Velad Galván 2ec64442e2 feat(HLS): Add support for EXT-X-DATERANGE (#6718)
Closes https://github.com/shaka-project/shaka-player/issues/3523
2024-06-03 10:10:39 +02: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
Dave Nicholas d38aabf04d feat(DASH): Add MPD Patch support (#5247)
Closes https://github.com/shaka-project/shaka-player/issues/2228

---------

Co-authored-by: Wojciech Tyczyński <wojciech.tyczynski@sky.uk>
2024-05-29 08:11:28 +02:00
Wojciech Tyczyński c541515995 fix: Ban smooth codec switching on Tizen 5 & 6 (#6686)
My recent tests on using smooth codec switch on Tizen 6.0 unfortunately
failed. Ban this platform together with Tizen 5.
2024-05-28 12:34:37 +02:00
Joey Parrish f4bcb355cd test: Add multiperiod test case mirroring partner bug (#6614)
A partner bug we are investigating involves content not being played at
4K when it could be. This test (which passes) helped us eliminate a
theory that our period-flattener was the cause.
2024-05-15 00:55:45 -07:00
Álvaro Velad Galván 87de6e01a5 test: Use MCap on StreamUtils tests (#6604)
This prevents any tests from being skipped in Safari.
2024-05-14 12:22:22 +02:00
Wojciech Tyczyński 0883c32ce6 feat: Parse XPath (#6470)
Required by #5247 

Simple XPath parser for tXml utils. Not used for now, but needed for MPD
Patch support.
2024-04-24 10:05:07 +02:00
Wojciech Tyczyński 8c549f3427 fix: Fix webOS 4 & 5 utility methods (#6463)
webOS platforms don't contain OS version explicitly in user agent,
instead they signal it via chrome version. This PR fixes webOS 4 & 5
methods and unifies all webOS check methods.
2024-04-22 10:46:46 +02:00
Casey Occhialini b17480e4d8 test: update CMCD tests to allow them to be run individually (#6342)
Closes #6331
2024-03-25 12:39:55 -07:00
Wojciech Tyczyński 0de7af94cd fix(DASH): Use labels to stitch streams across periods (#6121)
If available streams differ only by label, PeriodCombiner does not take it into account when looking for the best candidate. Due to that streams from newly arrived periods will create new audio tracks, as existing streams match always with firstly found stream from new period.

Issue has been mitigated by recent PeriodCombiner improvements, as label has been used for hash generation. But if hash don't match i.e. due to bandwidth change, issue would still appear.
2024-02-20 10:09:31 -08:00
Casey Occhialini 5a025fbccd feat: add includeKeys to CMCD config to allow filtering of CMCD data (#6248)
This PR adds the ability to filter/limit the amount of data transmitted
when CMCD is enabled. It matches the functionality provided in
[`dash.js`](https://github.com/Dash-Industry-Forum/dash.js/blob/9e3da3cb35da71d339444158db359bfec63035a0/src/core/Settings.js#L712-L713)
and
[`hls.js`](https://github.com/video-dev/hls.js/blob/dfb384dc765f400ea3d401b790cfc4d53a44410f/src/config.ts#L70-L75)
and addresses concernes raised by video providers: https://github.com/cta-wave/common-media-client-data/issues/122
2024-02-15 13:54:25 -08:00
Dave Nicholas a1c1620f09 feat: Escape html codes when getting node contents (#6198)
It would appear that the previous `textContent` api transformed html
entities. This PR provides feature parity with the DOMParser approach.
2024-01-31 15:12:16 +01:00
Casey Occhialini 78c12a6265 fix(CMCD): allow session id to be configured (#6192) 2024-01-31 10:21:01 +01:00
Álvaro Velad Galván 038e894e82 feat(CMCD): Add support to rtp parameter (#6184) 2024-01-30 20:02:30 +01:00
Álvaro Velad Galván 8a9f17d48b feat(CMCD): Add support to dl, nrr and nor parameters (#6171) 2024-01-29 18:57:26 +01:00
Álvaro Velad Galván 07ebdb1d2c fix: player Dropping Variant (better codec available) when it should not (#6163)
Fixes https://github.com/shaka-project/shaka-player/issues/6162
2024-01-25 18:41:08 +01:00
Dave Nicholas 7116a34ec2 feat!: Remove DOM Parser (#6063)
## Background: 
The native DOM Parser can perform poorly on some older devices, this
approach is faster on newer devices but is considerably better on older
devices.
This PR replaces the usage of the DOM Parser for DASH, MSS, VTT and
TTML.

The draw back of this approach that it does not include any validation
at the cost of better performance.
2024-01-22 08:39:06 +01:00
Wojciech Tyczyński 4022788a18 perf: PeriodCombiner improvements (#6005)
Summary of changes:
- create dummy streams during preparing arrays of input streams
- use hash map to quickly find perfect stream matches across periods
- hash map also automatically removes duplicates, so remove previous
logic for finding them
- check earlier are we trying to create output stream from dummy stream
- 2 changes from above also gives us a possibility to simplify
`areCompatible()` & `isBetterMatch()` methods
- reduce creation of spare collections when concatenating streams
- reduce conditional logic when possible

I was testing `PeriodCombiner.combinePeriods()` performance of mentioned
changes on Tizen 2021 on 2 streams and I've got following results:

| content | upstream | proposed changes |
| - | -: | -: |
| stream 1 | 23 ms | 17 ms |
| stream 2 | 484 ms | 191 ms |

Both streams are VOD.
Stream 1 has 18 periods with 6 video & audio tracks in each.
Stream 2 has 18 periods with 6 video tracks & 36 audio tracks in each.
2024-01-09 11:21:01 +01:00
Casey Occhialini b463e391c3 fix: text roles being combined incorrectly in some multiperiod cases (#6055)
Resolves #6054
2024-01-09 07:18:05 +01:00
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 7683892106 fix: Fix ESDS box parser (#5952) 2023-11-30 02:37:53 +01:00
Álvaro Velad Galván 966b910edc feat: Add support for Common Media Server Data (CMSD) (#5900)
Closes https://github.com/shaka-project/shaka-player/issues/5890
2023-11-20 14:07:13 +01: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 42f491f782 feat(DASH): Add support for Content Steering (#5710)
Related to https://github.com/shaka-project/shaka-player/issues/5704
2023-11-09 08:34: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
pszemus 6a862d265a feat(ID3): decode APIC frames (#5857)
Since the official ID3 site (https://id3.org) is not available, I used a
mirror
(https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2.4.0-frames.html#apic)
to implement the decoding of APIC frames.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2023-11-06 10:37:56 +01:00
Álvaro Velad Galván ae423b4239 fix: Fix nalu parsing and improve performance in the transmuxer (#5846)
Fixes https://github.com/shaka-project/shaka-player/issues/5666
Fixes https://github.com/shaka-project/shaka-player/issues/5797
2023-11-02 17:54:28 +01:00
Wojciech Tyczyński 155befb0a0 fix: ban new Uint16Array(buffer) (#5838)
Due to typo, banned call has been executed.
Fixes typo and adds support to `Uint16Array` in `BufferUtils`.
2023-10-31 14:41:25 +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
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
Álvaro Velad Galván d9b49d992f fix: Allow PID change in TsParser (#5681)
This is necessary because some Live streams change audio or video PID
when there are ads.
2023-09-26 20:41:42 +02:00
baconz 845649b001 fix: Typing of PeriodCombiner.Period was incorrect (#5442)
When we exported `PeriodCombiner` in
https://github.com/shaka-project/shaka-player/pull/5324 we added an
`@export` to `PeriodCombiner.Period`, and since then we've been testing
in our dogfood builds using shaka-player.compiled.debug, because we like
to get logs from dogfood. Everything was working great.

When we went to switch over to the production build, we realized that
`@export` on a `typedef` doesn't really work because the type gets
minified internally!!

This moves `Period` over to `extern` so that it does not get minified
and can be used externally.
2023-08-15 17:36:06 +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
Konstantin Grushetsky fa041d776d feat: Enhance Audio Language Switching (#5223)
Resolves #5222.

It also opens the way for improving the compliance with [RFC
5646](https://datatracker.ietf.org/doc/html/rfc5646) in the future.
2023-05-11 11:30:56 +02:00
/zɒ̃ge/ bf4b4a54cc fix: config.streaming.preferNativeHls only applies to HLS streams (#5167)
Closes #5166
2023-04-25 09:36:07 +02: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
Casey Occhialini fe38e45f4d fix: Adds missing CMCD params to some http requests (#5072)
Fixes #5067
Fixes #5094

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2023-03-15 02:13:16 -07:00
Álvaro Velad Galván d465942c43 feat(HLS): Improve detection of basic info from Media Playlist (#4809) 2023-01-26 23:46:46 -08:00
Joey Parrish 5b9d25325c chore: revert "Forbid MathML namespace in shaka.util.XmlUtils" (#4930)
Reverts shaka-project/shaka-player#4919
2023-01-24 09:33:16 -08:00
Tobias Smolka 4bd3adc8cb fix: Forbid MathML namespace in shaka.util.XmlUtils (#4919)
This PR fixes #4912 by adding MathML to the list of forbidden
namespaces.
2023-01-20 13:22:05 +01: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
Joey Parrish 2fb432b735 test: Fix XML parser security tests on Xbox (#4695)
Xbox seems to treat SVG and/or XML a little differently than other
platforms, which led to a test failure on that platform. That went
unnoticed because Xbox is offline in our lab. The issue was discovered
while working to restore that platform in the lab test runs.
2022-11-11 12:07:52 -08:00
Álvaro Velad Galván 0d67ecd7cb fix: DAI ID3 metadata parsing (#4616)
Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-10-28 14:20:44 -07:00
Casey Occhialini 81ccd5c73b fix: Fix multi-period DASH with descriptive audio (#4629)
Perform the `primary` check after `role` check to improve period
flattening on streams with both `main` and `description` audio tracks.

Resolves #4500

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2022-10-28 07:47:33 +02:00