Commit Graph

978 Commits

Author SHA1 Message Date
Justin Swaney bb712c0283 fix: Fix detection of flac support on Safari (#6250)
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
2024-02-15 17:17:07 -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
Julian Domingo 93d616e954 feat: add an option specifying when source buffer removals happen (#6242)
Increases the default required removal duration from `0.01` => `1.0`.

Closes #6240.
2024-02-12 10:00:44 -08:00
theodab 489b11a959 feat: Add preload system to player (#5897)
Adds a new player method, preload. This asynchronous method creates a PreloadManager object, which
will preload data for the given manifest, and which can be passed to the load method (in place of an asset URI)
in order to apply that preloaded data. This will allow for lower load latency; if you can predict what asset will
be loaded ahead of time (say, by preloading things the user is hovering their mouse over in a menu),
you can load the manifest before the user presses the load button.
Note that PreloadManagers are only meant to be used by the player instance that created them.

Closes #880

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-02-02 00:27:29 -08:00
Gary Katsevman 8fc292bc28 feat: vod dynamic playback rate buffer control (#6172)
Dynamically update playback rate to keep the buffer full.

Related to https://github.com/shaka-project/shaka-player/issues/6131
2024-02-02 08:53:21 +01:00
Álvaro Velad Galván 278c7bc8cf feat: Detect maximum HW resolution automatically on some platforms (#6180) 2024-02-01 19:47:53 +01:00
Álvaro Velad Galván fc38aeebe3 feat!: Prefer MSE HLS over native HLS in Apple platform when not encrypted (#6188)
Our HLS implementation is stable and robust enough that we can enable it
by default.
2024-02-01 09:45:16 +01:00
Joey Parrish 62be6da72b docs: Add missing license details after tXml import (#6206) 2024-01-31 13:22:40 -08:00
Álvaro Velad Galván 202f3082fd feat: Add disableTextPrefetch config (#6197) 2024-01-31 19:35:48 +01: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 47602c6f5e feat!: Remove com.adobe.primetime keysystem (#6189)
`com.adobe.primetime` is not implemented in any browser and no one has
reported any problems in the 8 years of Shaka Player.
2024-01-30 20:02:44 +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 3537dc0a68 fix(CMCD): Allow reconfigure session ID (#6177) 2024-01-30 08:53:46 +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 33b40cfcce fix(CMCD): Fix CMCD for some mimetypes in src= (#6178) 2024-01-29 18:09:52 +01:00
Gary Katsevman a8ab0c824b feat: prefetch audio languages. (#6139)
Closes #6128
2024-01-29 08:35:17 +01:00
Álvaro Velad Galván eb1fef888b fix: Fix wrong aspect ratio in transmuxed videos (#6170)
Fixes https://github.com/shaka-project/shaka-player/issues/6168
2024-01-26 18:39:10 +01:00
Mathieu Côté 08cc34a532 fix: AC-3 audio codec support on Tizen (#6166)
Fixes https://github.com/shaka-project/shaka-player/issues/6160
2024-01-26 15:29:25 +01:00
theodab bd944d15db feat(text): Add MediaSource.modifyCueCallback (#6167)
This callback gives developers a chance to modify cues after they are
parsed but before they are appended.
2024-01-25 23:36:48 -08: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
Gary Katsevman 65981e2aae feat: add a live sync panic mode (#6149)
This PR introduces a live sync panic mode
(`streaming.liveSyncPanicMode`) which sets the player into the
`streaming.liveSyncMinPlaybackRate` while we're within the
`streaming.liveSyncPanicThreshold`. This should help reduce the change
of subsequent rebuffering events by moving further away from the live
edge.

Related to #6131.
2024-01-25 10:33:57 +01:00
Álvaro Velad Galván 701ec9bece fix(HLS): Fix VVC codec selection in HLS (#6156) 2024-01-24 20:15:14 +01:00
Álvaro Velad Galván 151b29c3c7 feat: Parse vpcC and av1C boxes (#6157) 2024-01-24 18:26:01 +01:00
Álvaro Velad Galván 8d6ad7ed64 feat(HLS): Add support for SUPPLEMENTAL-CODECS (#6155) 2024-01-24 18:25:44 +01:00
Álvaro Velad Galván c100053532 feat: Add support for Dolby Vision based on AVC and AV1 (#6154) 2024-01-24 18:15:18 +01:00
Álvaro Velad Galván b8520ed977 feat: Parse avcC, hvcC and dvcC boxes (#6146) 2024-01-23 19:49:51 +01:00
Álvaro Velad Galván df8dbb9caa fix: Fix nalu parsing in TS (#6137)
Fixes https://github.com/shaka-project/shaka-player/issues/6136
2024-01-22 18:03:36 +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
Álvaro Velad Galván e692d68ecf fix: Reject Opus encrypted on Firefox Android (#6115)
Fixes https://github.com/shaka-project/shaka-player/issues/6111
2024-01-18 08:10:34 +01:00
Álvaro Velad Galván af12b0b3f0 fix(DASH): Fix PERIOD_FLATTENING_FAILED on fastswitching streams (#6113) 2024-01-17 09:01:39 +01:00
Wojciech Tyczyński 5e3db78a5e feat(DASH): Allow PeriodCombiner for using streams once (#6097)
In our streams we have guarantee that every track will have a single
match in every period. This change allows `PeriodCombiner` to take
benefit of this knowledge.

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 | 17 ms | 12 ms |
| stream 2 | 191 ms | 98 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-15 08:11:46 +01:00
Ivan 08c2052fd9 chore(language): make normalize function more readable through destructuring (#6094) 2024-01-12 17:07:16 +01:00
Casey Occhialini ed0aa22c48 fix: do not append blank codec strings (#6093)
Resolves #6092
2024-01-12 07:28:58 +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
Álvaro Velad Galván a371f434ac fix(DASH): Fix bad error on DASH DAI (#6047)
Fixes https://github.com/shaka-project/shaka-player/issues/6010
2024-01-09 08:47:31 +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
Viktor Vasylkovskyi 7f5005db23 fix: APL set-top box wrongly identifies as an Apple device. (#6026) 2024-01-08 11:50:11 +01:00
Ivan f52dd2b462 perf(mp4generator): stop nesting concat in methods (#6041)
This change removes `concat` util function from mp4 generator iterations
and runs it later, as well as stops creating new Uint8 arrays, as
`concat` does this within itself.
2024-01-08 10:31:12 +01:00
Ivan cd326e2691 perf(transmuxer): various performance improvements (#6003)
This change improves loop performance - creating new arrays is not
performant in large loops, and a traditional for loop is more performant
than for .. of for large concatenations

---------

Co-authored-by: Ivan Kohut <ivan.kohut@lamin.ar>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-01-08 10:30:00 +01:00
wjywbs dd500285c2 perf: ts parser O(n^2) performance bug. (#6035)
This caused high cpu usage when the ts file segments are large.
2024-01-08 09:33:31 +01:00
Vasanthavanan Devarajan 3bf0664457 fix: ENCRYPTED CONTENT WITHOUT DRM INFO on comcast X1 due to safari blocklist (#6034) 2024-01-08 09:27:34 +01:00
Álvaro Velad Galván 165feacb00 fix: Fix transmuxer when some PES has the same pts and dts value (#5985)
Fixes https://github.com/shaka-project/shaka-player/issues/5913
2023-12-05 08:08:34 +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 90bc6a7c78 feat: Add config to prefer spatial audio (#5963) 2023-12-01 06:47:47 +01:00
Álvaro Velad Galván 7683892106 fix: Fix ESDS box parser (#5952) 2023-11-30 02:37:53 +01:00
Koen Romers 503327a0e3 feat: add preferred video label (#5948)
Closes https://github.com/shaka-project/shaka-player/issues/5947
2023-11-29 11:37:57 +01:00
Álvaro Velad Galván 0deb25b57f feat: Add config to allow Media Source recoveries (#5938) 2023-11-28 08:50:18 +01:00
Álvaro Velad Galván 6102060028 fix: Fix transmuxer when sample has no video data (#5933)
Fixes https://github.com/shaka-project/shaka-player/issues/5931
2023-11-27 10:28:14 +01:00
Álvaro Velad Galván 8f453c245f feat(DASH): Add support for location in Content Steering (#5914)
According to
https://github.com/Dash-Industry-Forum/Dash-Industry-Forum.github.io/files/11722876/DASH-IF-CTS-001-1.0.0.pdf,
Location elements can have serviceLocation, so we need support it.
2023-11-22 23:02:01 +01:00