Commit Graph

317 Commits

Author SHA1 Message Date
Álvaro Velad Galván 4082ed75ee feat(DASH): Add support for SegmentTimeline@Pattern (#9669)
Close https://github.com/shaka-project/shaka-player/issues/9659
2026-02-06 07:31:49 +01:00
Chad Michael 42df30a84e fix(DASH): Handle external SegmentBase BaseURL and SIDX offset fallback (#9477)
This pull request improves support for external SIDX (Segment Index)
files in DASH manifests, particularly when the `RepresentationIndex`
uses a different `BaseURL` or `sourceURL` than the media itself. It also
enhances base64 decoding robustness and adds a new unit test to verify
correct behavior.

**DASH SIDX and Segment Reference Handling:**

* Enhanced `Mp4SegmentIndexParser.parse` to accept an `indexIsExternal`
parameter, enabling correct parsing of SIDX files that are external to
the media and may have different base URIs. The parser now adjusts the
offset logic for external indices.
[[1]](diffhunk://#diff-6435d27cfd56024b0920175aa9a6992242d18900d27f7edfaa77d89673a8dd0aR29-R37)
[[2]](diffhunk://#diff-6435d27cfd56024b0920175aa9a6992242d18900d27f7edfaa77d89673a8dd0aR54-L63)
* Addresses #6091: Updated `SegmentBase.generateSegmentIndexFromUris` to
detect when the index URI is external by comparing the base URIs, and to
pass this information to the parser. This ensures that segment
references are resolved against the correct URIs.

**Robustness Improvements:**

* Improved base64 decoding in `Uint8ArrayUtils.fromBase64` by
normalizing padding, handling cases where the input string omits
trailing `=` characters.

**Testing Enhancements:**

* Added a unit test to verify that `RepresentationIndex` with a
different `BaseURL` or `sourceURL` is correctly honored, ensuring that
segment index requests use the proper URI and range.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-12-12 10:25:08 +01:00
Matthias Van Parijs 0bc7a96b33 fix(DASH): Shift segment timeline with cached presentationTimeOffset (#9481)
Fixes https://github.com/shaka-project/shaka-player/issues/9480.

A change in PTO when updating periods & segment timelines should be
avoided by whatever produces the manifest. This is merely a mitigation.
When detected, it'll log an error to warn the user about the timeline
shift.
2025-12-09 12:30:40 +01:00
Álvaro Velad Galván 2a454911c9 fix(FairPlay): Fix FairPlay compatibility with DASH (#9436)
This creates an initdata for FairPlay if one is not defined, which is
what happens in DASH when there is no PSSH
2025-11-26 12:12:53 +01:00
Álvaro Velad Galván 945c57ab77 feat!: Remove all deprecated things (#9162) 2025-10-07 10:52:13 +02:00
Álvaro Velad Galván 85e8990e0e test: Disable multi type variants test on some devices (#8982)
Some tests are generated with old tools that produce random errors in
decoding, so it is best to disable it for now. Due
https://github.com/shaka-project/shaka-player/issues/2746
2025-08-18 10:58:26 +02:00
Álvaro Velad Galván e8ccbeeedd fix(DASH): Update SegmentSequenceProperties according to latest spec (#8909)
Update according to
https://github.com/MPEGGroup/DASHSchema/pull/150/files
2025-07-26 21:45:23 +02:00
Álvaro Velad Galván bf26c3fb4b feat(DASH): Remove multiTypeVariantsAllowed config and add support for it on all browsers (#8858) 2025-07-15 09:26:04 +02:00
Emil Santurio 7526f2b2e9 fix(DASH): Change start number for SubNumber templating, based on DASH 6th edition (#8860)
Close #8859
2025-07-10 12:05:54 +02:00
Álvaro Velad Galván 5b5e2220e4 feat(DASH): Add support for certificate acquisition URL (#8824)
Close https://github.com/shaka-project/shaka-player/issues/8823
2025-07-01 13:24:40 +02:00
Gregory McGarry 88627c3714 fix(DASH): Use the correct Representation ID for Uri substitution of media segments (#8760)
For DASH segment templates, MpdUtils.fillUriTemplate() is used for
substitution of tokens in the fetch URL, like $RepresentationID$. When
supplemental codecs are used, the incorrect RepresentationID will be
substituted for media segments. The initialisation segment is correctly
substituted.

The symptom is that fetches for media segments will fail with 404
response codes.
2025-06-20 11:27:07 +02:00
v-nova-romas 4ef126b2d0 fix(LCEVC): Ensure unique originalVideoId for LCEVC dual-track (#8562)
In LCEVC dual-track implementation, both tracks share the same
originalVideoId, which causes one to be dropped when `getVideoTracks()`
returns them as a Map. This PR assigns a unique originalVideoId to each
track to ensure both appear correctly in the resolution menu
2025-05-07 18:03:49 +02:00
Álvaro Velad Galván 047ae55637 test: Unify DRM checking in tests (#8504) 2025-04-24 18:29:36 +02:00
Gary Katsevman 6e029d1753 fix(CEA): cache and restore cea decoders based on the period continuity for dash content that uses SegmentTemplate (#8378)
We had an issue where in SSAI content, 708 data was being split by ad
periods. Currently, when this happens, we reset the 708 decoder, which
means that captions are lost. Instead, we want to cache this decoder for
a later time. This change keeps track of continuous periods and caches
the 708 decoder when a period change happens to a discontinuous period.
This is so that it could be later restored if we go back to a continuous
period.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-04-23 10:00:02 +02:00
Wojciech Tyczyński a7abb2967a fix(DASH): Fix live playback with Period duration (#8493)
Fixes #8481
2025-04-22 14:53:00 +02:00
Álvaro Velad Galván 396bdf69df perf(DASH): Release period combiner after parsing a VOD (#8443) 2025-04-11 12:24:25 +02:00
Wojciech Tyczyński ce08da5609 feat(DASH): Parse ProducerReferenceTime nodes (#8439)
This PR introduces support for `ProducerReferenceTime` tags in DASH.
When finding any, it emits event, similar to inband PRFTs added in
#4389.
Additionally, calculated start date from `ProducerReferenceTime` is used
as program start date, as it's more accurate value than
`MPD#availabilityStartTime` used before.
2025-04-10 16:49:47 +02:00
Wojciech Tyczyński 51ff82f204 build: Migrate to stylistic eslint plugin (#8298)
Fixes #8278
Migrates deprecated rules from `eslint-config-google` and our rules as
well to stylistic.
Additionally removes broken `eslint-disable` python check and replaces
with eslint `reportUnusedDisableDirectives` option.
2025-03-19 16:18:30 +01:00
Álvaro Velad Galván be12a7f132 build: Move EBML parser to dash to improve the build size (#8189) 2025-02-28 15:14:39 +01:00
Álvaro Velad Galván 8f0b0e3282 feat(LCEVC): Detect as supported dual track content with LCEVC (#8134)
This PR does not yet add enhancement layer decoding support.
2025-02-21 13:28:56 +01:00
Álvaro Velad Galván 5c3e1a0fea fix(DASH): Revert Dolby Atmos detection when there is not SupplementalProperty (#8132)
Reverts
https://github.com/shaka-project/shaka-player/commit/cf581cd039db62b658f6851590b6c623bd7bf924
Reverts
https://github.com/shaka-project/shaka-player/commit/56c5f52c9a69d87f005163f7d0def1a49d8d599d
2025-02-20 14:23:40 +01:00
Álvaro Velad Galván defea159de build: Move some types to improve the build size (#8096) 2025-02-18 11:02:49 +01:00
Álvaro Velad Galván 171bdb3354 feat(Ads): Update DASH Media Presentation Insertion according to the latest draft (#8065) 2025-02-12 15:56:17 +01:00
Álvaro Velad Galván 4936b0c230 feat(DASH): Add dependencyVideo to video streams (#8057)
This will allow us to support dual tracks (main and enhancement layer)
in the future, for example with the LCEVC codec.
2025-02-11 18:20:25 +01:00
Julian Domingo 9461bc2455 feat(HLS): Add an option to ignore DRM info (#7986)
Fixes https://github.com/shaka-project/shaka-player/issues/7985.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-01-30 11:02:48 +01:00
Álvaro Velad Galván abaf82f5ab feat: Simplify ignoreSupplementalCodecs config (#7967) 2025-01-29 12:45:54 +01:00
Koen Romers 56c5f52c9a fix(DASH): Fix Dolby Atmos detection (#7966)
dolby digital plus tracks can have a bandwidth of exactly 384000

Fixes https://github.com/shaka-project/shaka-player/issues/7965
2025-01-28 13:44:12 +01:00
Wojciech Tyczyński 6e55a3b21b build: Forbid using dot in generic types (#7904)
Fixes #2643

Happy reviewing!
2025-01-20 09:39:51 +01:00
Álvaro Velad Galván 8fda5d86bb feat(DASH): Extract PlayReady licenseServerUri from PSSH (#7898) 2025-01-17 10:20:36 +01:00
Wojciech Tyczyński 82f7eafdc5 build: Add new JSDoc rules to ESLint (#7897)
Adds a replacement for removed JSDoc checks from ESLint v9.
Additionally fixes lots of issues found in the JSDoc, such as:
- missing `@param`/`@return` annotations
- bad formatting
- params order
- param name in the same line as type definition (tried to disable it,
but it was causing other issues and we didn't have lots of places with
such formatting)

Minor fixes in code found by Closure Compiler after fixing JSDoc are
also included.
2025-01-17 09:28:19 +01:00
vlazh 7ef0f924c3 feat: Add support for WisePlay DRM (#7854)
Some info:
https://drmnow.pro/wiseplay/

https://developer.huawei.com/consumer/en/doc/Media-Guides/client-dev-0000001050040000

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-01-09 16:18:23 +01:00
Joey Parrish abd6d8b34c fix(dash): Fix $Time$ usage with SegmentTemplate (#7849)
`$Time$` in SegmentTemplate should not be adjusted for
presentationTimeOffset or Period start. It should always match the
segment's own media timestamp as it appears in the manifest.
2025-01-08 11:23:40 -08:00
Álvaro Velad Galván cf581cd039 fix(DASH): Fix Dolby Atmos detection when there is not SupplementalProperty (#7847)
The correct way is to use JOC, but some packagers do not use it.
2025-01-08 19:55:48 +01:00
Wojciech Tyczyński 51765e9693 build: Change spellchecking tool and fix spelling mistakes (#7765)
Fixes #7693
2024-12-20 12:27:05 +01:00
Álvaro Velad Galván bed9426061 chore: Add PlayReady utils (#7785) 2024-12-20 12:26:52 +01:00
Álvaro Velad Galván 6616ff202a feat: Simplify the use of low latency (#7748)
The autoLowLatencyMode config is removed because it's no longer
necessary. Now lowLatencyMode only enable low latency if the stream is
low latency.

A new method is added (configurationForLowLatency) to allow configure
the Low Latency config more easily
2024-12-20 10:27:39 +01:00
Álvaro Velad Galván 279e6cdd01 fix: Fix support for supplemental codecs (Dolby Vision) (#7720)
Based on the work of @gmcgarry Thank you very much!

Currently the codec adds supplemental codecs to the list of allCodecs
and has an implicit priority order to select a codec. Support for the
codec is tested with MediaSource.isTypeSupported().

There are multiple issues with this approach:

- the priority is implicit
- MediaSource.isTypeSupported() decision is effectively overriding
platform-specific MediaCapabilities logic
- MediaSource.isTypeSupported() is frequently wrong depending on whether
the content is encrypted

This patch duplicates the variant with each supplemental codec and
defers codec priority and codec selection until after
MediaCapabilities.decodingInfo().

This fixes support for DolbyVision Profile 8, which is otherwise broken
because the chromium browsers always return false from
MediaSource.isTypeSupported(), and DolbyVision is commonly only
available in a secure hardware decode pipeline.

Note: Safari does not have this problem since it supports Dolby Vision
in clear

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2024-12-09 12:46:58 +01:00
Álvaro Velad Galván e1d1d19555 feat: Add configuration to ignore SCTE214 supplemental codecs (#7717)
Based on the work of @gmcgarry Thank you very much!
2024-12-05 15:14:22 +01:00
Álvaro Velad Galván 2260aa9cf6 feat: Update usage of minBufferTime according to the DASH spec (#7616)
Related to
https://github.com/shaka-project/shaka-player/issues/7602#issuecomment-2479518970

From 23009-1:

The value of the minimum buffer time does not provide any instructions
to the client on how long
to buffer the media. The value however describes how much buffer a
client should have under
ideal network conditions. As such, MBT is not describing the burstiness
or jitter in the network,
it is describing the burstiness or jitter in the content encoding.
Together with the BW value, it is
a property of the content. Using the "leaky bucket" model, it is the
size of the bucket that makes
    BW true, given the way the content is encoded
2024-11-19 10:47:18 +01:00
Álvaro Velad Galván d8a14b0a45 fix(DASH): Fix playback after DASH period eviction (#7603)
Fixes https://github.com/shaka-project/shaka-player/issues/7516 in a
simpler way

Reverts
https://github.com/shaka-project/shaka-player/commit/5eff0384d04e22a971336c90aae0a83db2a451d5
Reverts
https://github.com/shaka-project/shaka-player/commit/037193c2d601e02c8611a4527dcb04d32adbbd27
2024-11-15 13:23:40 +01:00
ncocaign 5eff0384d0 fix(DASH): Fix playback after DASH period eviction (#7519)
With this change, closeSegmentIndex() of all streams of a removed period
are defered in StreamingEngine.onUpdate_()

Fixes #7516
2024-11-13 19:14:15 +01:00
Álvaro Velad Galván 5024184363 feat: Enable audio groups by default (#7549)
This fixes the audio selection in Shaka Player History live stream

Related to https://github.com/shaka-project/shaka-player/pull/5620
2024-11-06 13:20:30 +01:00
Gregory McGarry c9f7723d23 feat: Support Fairplay DRM in DASH manifest. (#7454)
Support Fairplay DRM for DASH, specifying the license server in the
manifest using dashif:Laurl.
2024-10-24 09:36:35 +02:00
Gregory McGarry 669b7b3829 fix: calculations of channel count for DASH AudioChannelConfiguration elements. (#7421)
Fix tag:dolby.com,2014:dash:audio_channel_configuration:2011 scheme to
correctly handle bits that represent channel pairs according to document
at
[dolby.com](https://ott.dolby.com/OnDelKits/DDP/Dolby_Digital_Plus_Online_Delivery_Kit_v1.5/Documentation/Content_Creation/SDM/help_files/topics/ddp_mpeg_dash_c_mpd_auchlconfig.html)

Add tag:dolby.com,2015:dash:audio_channel_configuration:2015 scheme
according to ETSI TS 103 190-2 v1.2.1, Annex G.3

Test stream is available here:
[manifest.mpd](https://content.media24.link/ac4_512/manifest.mpd)
2024-10-21 09:23:57 +02:00
Joey Parrish d81c9cb369 test: Deduplicate platform support check (#7450)
This deduplicates a platform support check that was run in
player_integration.js, and declares the pre-existing central support map
in an extern so we can clean up its use.

This stops a DRM integration test from timing out on FirefoxWindows. It
still gets skipped, though, due to a failing Widevine check, so there
will be follow-on work for that.

Issue #7449
2024-10-21 09:21:56 +02:00
Álvaro Velad Galván e7229fbc18 fix(DASH): Allow mixing SegmentTemplate-SegmentTimeline with SegmentTemplate-numbering (#7286)
Fixes https://github.com/shaka-project/shaka-player/issues/7192
2024-09-12 09:45:29 +02:00
Wojciech Tyczyński c541b1c9b4 fix(DASH): Use presentationTimeOffset in EventStream (#7282)
Fixes #7277
2024-09-11 11:03:33 +02:00
Álvaro Velad Galván d5ed8edaf5 feat(DASH): Disable xlink processing by default (#7264)
Since xlink processing is slow and very few streams use it, it is best
to disable this functionality by default to improve performance
especially on STB or SmartTV devices.
2024-09-05 12:05:43 +02:00
Álvaro Velad Galván 7b07614532 feat: Add manifest.disableIFrames config (#7255) 2024-09-04 16:14:13 +02:00
Álvaro Velad Galván cb5aae47c0 feat(DASH): Support trick-mode per resolution (#7224) 2024-08-28 14:59:40 +02:00