Commit Graph

395 Commits

Author SHA1 Message Date
Álvaro Velad Galván e9551b3ee2 feat(MSF): Add accessibility parsing in the catalog (CEA-608/708) (#10040)
Related to https://github.com/moq-wg/msf/pull/133
2026-05-12 21:15:17 +02:00
Álvaro Velad Galván b113cadd36 fix: handle AC-4 immersive stereo (IMSA) in HLS and DASH spatial audio detection (#10007)
More info:

https://ott.dolby.com/OnDelKits/AC-4/Dolby_AC-4_Online_Delivery_Kit_1.5/Documentation/Specs/AC4_HLS/help_files/topics/hls_playlist_c_codec_indication_ims.html

https://ott.dolby.com/OnDelKits/AC-4/Dolby_AC-4_Online_Delivery_Kit_1.5/Documentation/Specs/AC4_DASH/help_files/topics/MPEG_dynmc_adpt_strmg_c_mpd_for_ims.html
2026-04-20 19:33:14 +02:00
Ivan 3a5d588dbd perf(DASH): drop array operations on unique IDs when parsing periods (#9870)
Two targeted performance improvements in aimed at reducing overhead on
older devices

1. Avoid intermediate array for representation ID uniqueness check

Previously, all representation IDs were pushed into a temporary ids[]
array, then a Set - this PR eliminates the array allocation entirely.

2. Re-parse only affected AdaptationSets for dependency streams

Previously, when any stream had a dependency stream, every AdaptationSet
was re-parsed from XML. Now, only the specific AdaptationSet nodes that
contain streams with dependencies are re-parsed. This avoids redundant
XML traversal and parsing for the common case where most adaptation sets
have no dependency streams.
2026-03-23 10:09:42 +01:00
Ivan c9f8057f9a perf(DASH): loop over adaptation sets using the partition method (#9862) 2026-03-20 15:45:57 +01:00
Álvaro Velad Galván 72a8e942b5 fix(LCEVC): Fix live support when using DASH dual track (#9841) 2026-03-19 11:54:29 +01:00
Álvaro Velad Galván b9abb399bb fix(LCEVC): Fix multi-period VOD support (#9837)
A new integration test has been added.
The use of `stream` within `stream` in `periods.js` has been refactored
to simplify management and avoid duplicates.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-03-19 10:07:14 +01:00
Gábor Balogh 1c83a69481 perf(DASH): Add period caching to speed up manifest parsing (#9353)
Adds period caching to speed up manifest parsing. The aim of this
feature is to improve parsing of length multi-period DASH manifests on
low power devices.
2026-03-11 10:03:10 +01:00
Álvaro Velad Galván c92c3bddba feat(DASH): Add json format support (#9788)
This initial support is complete but not efficient, as it involves
conversion to XML and normal processing. It should only be used for
testing purposes. Improved support will be added in the future.

Tested with https://github.com/Dash-Industry-Forum/dash-json-schema

Note: This is only added to the experimental build.
2026-03-09 09:52:06 +01:00
Álvaro Velad Galván 90f59213bb fix: Honors streaming.retryParameters for segments (#9796)
Fixes https://github.com/shaka-project/shaka-player/issues/9787
2026-03-06 20:23:25 +01:00
Álvaro Velad Galván e3781c493b feat(DASH): Enable automatic XLink processing with fast detection and performance improvements (#9764)
This PR modernizes and optimizes XLink handling in the DASH parser by
removing the legacy flag-based behavior and replacing it with a
standards‑aligned, fast, and deterministic workflow. The changes improve
performance on large MPDs, simplify configuration, and ensure correct
XLink expansion according to DASH/XLink rules.

XLink processing is now automatically enabled only when needed. If the
MPD contains no XLinks, the parser skips processXlinks entirely.
2026-02-26 14:05:32 +01:00
Á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
Andy(김규회) 05b09728c7 perf: Use Map.getOrInsert/getOrInsertComputed native methods (#9546)
Added polyfills for `Map.getOrInsert()` and
`Map.getOrInsertComputed()` from the TC39 upsert proposal and refactor
the codebase to use them.
These methods replace the common "check if key exists, then set default"
pattern with a single atomic operation. This improves code readability
and eliminates redundant map lookups throughout the player.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-01-13 10:57:25 +01:00
Gábor Balogh 219c733015 fix(DASH): Memory leak on DASH streams (#9369)
Fixes https://github.com/shaka-project/shaka-player/issues/9368
2025-11-21 09:55:00 +01:00
Álvaro Velad Galván c920ecd4fa chore: Move createSegmentRequest to shaka.net.NetworkingUtils (#9363) 2025-11-05 21:05:49 +01:00
Álvaro Velad Galván 7ccb20a641 feat(HLS): Add support for com.apple.hls.chapters (#9195)
Spec:
https://developer.apple.com/documentation/http-live-streaming/providing-javascript-object-notation-json-chapters

Add disableChapters config
Update the UI to show chapters if there is only one language Add support
to download chapters

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-10-14 15:20:51 +02:00
Álvaro Velad Galván 0ecc68c8ad feat(DASH): Add programinformation event (#9202) 2025-10-14 13:16:23 +02:00
Álvaro Velad Galván 945c57ab77 feat!: Remove all deprecated things (#9162) 2025-10-07 10:52:13 +02:00
Gary Katsevman 729cea8fc4 feat: Change dvvC box to free box for Dolby Vision workarounds (#9101)
This is based on
https://professionalsupport.dolby.com/s/article/Guidelines-to-developers-building-DASH-HLS-player-apps-for-LG-WebOS-Chromecast-and-other-Chromium-based-app-development-platforms?language=en_US
2025-09-17 10:21:12 +02:00
Wojciech Tyczyński a054b7e6ad perf(DASH): Do not store duplicated pssh data buffers (#9006)
Use PSSH string to cache init data in order to avoid creating duplicated
init data buffers. On streams with many periods due to ad insertion it
can make a difference - i.e. on stream with 50 periods this change
reduces used memory by init data buffers from 40 KB to 1 KB.

In DASH, PSSH can often be a duplicated data between protected periods
and/or adaptation sets.
2025-08-21 11:06:40 +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
Wojciech Tyczyński ca63ed07a2 chore(DASH): Add comments to latest DashParser changes (#8888)
Follow up to #8884 based on comment
https://github.com/shaka-project/shaka-player/pull/8884#discussion_r2213944738
2025-07-18 12:21:51 +02:00
Wojciech Tyczyński 27163ff82c fix(DASH): Prevent memory leak in uncompiled mode (#8884)
Keeping `this` references in DASH uri callbacks leads to keeping
DashParser instances in memory after unloading.
Luckily this is only the issue in uncompiled mode, Closure Compiler
handles it somehow. It is though better to fix it in case we change
tooling some day.
2025-07-17 13:46:14 +02:00
Álvaro Velad Galván 1f115d3846 fix(DASH): Fix segmentSequenceCadence default value (#8877)
According to the latest draft of DASH 6th edition, the default value is
1, not 0.
2025-07-16 10:23: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
Joey Parrish 7c1e31d4e6 chore: Add trailing commas to all record types (#8820)
Now that jsdoc supports this, it will make future diffs cleaner. See
#8819 and #1236.
2025-06-30 13:36:04 -07:00
Álvaro Velad Galván 93117d2ace feat: Add enableAudioGroups config (#8792)
Close https://github.com/shaka-project/shaka-player/issues/8684
2025-06-25 12:46:38 +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
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
Á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
Matthias ab01bb724a feat(DASH): Add support for "Spoken Subtitles" in tva:metadata:cs:AudioPurpose (#8364) 2025-03-31 15:46:52 +02:00
Matthias 369916489e feat: Add config to allow reset MSE on cross boundary (#8156)
There's devices out there that are not compliant with the MSE spec. Such
as halting MSE when a secondary init segment is appended (webOS 3), or
failing to transition from a plain to encrypted init segment (Tizen
2017). While we initially prefer content workarounds, it's a time
consuming and trial & error process. For some devices it might not be
worth investing time into finding a proper workaround due to low usage.
We're giving people an alternative by resetting MSE when needed
(configurable). dash.js offers somewhat similar behavior
[here](https://github.com/Dash-Industry-Forum/dash.js/blob/a656ec709e7f92f76b392bf196ee9883da7928ce/src/streaming/controllers/StreamController.js#L672),
where MSE is reset before applying an encrypted init segment.

This PR introduces `crossBoundaryStrategy` in `StreamingConfiguration`.
It can be configured as following:

- KEEP - we're keeping MSE active, this is the default and the current
behavior.
- RESET - we'll always reset MSE when it crosses a boundary.
- RESET_TO_ENCRYPTED - we reset MSE when it crosses an encrypted
boundary, and we keep MSE afterwards. Additionally, we're not going to
reset when we're crossing a plain to plain boundary.

Each initSegmentReference now holds an `encrypted` and `boundaryEnd`
value. When configured with a different value than KEEP,
`StreamingEngine` will be instructed to fetch and append segment
references up until the boundary of the currently applied init segment.

We detect whether we're at a boundary in a few ways:

- Listening to the HTML5 MediaElement's `waiting` event, this'll
indicate that we do not have enough buffer to advance. If we're pretty
close to the boundary, we assume we're at the boundary.
- Due to subtle differences in the segment alignments, waiting wasn't
reliable. When close to a boundary, a timer is fired with the assumption
that "we'll reach the boundary at soon". I've set the threshold to 1
second, when playhead is further than the threshold, we'll skip checking
whether an MSE reset is due.

The implementation relies on the added properties in the init segment
reference, and the concept of a "Period" is avoided in StreamingEngine
to ensure it's compatible with HLS too.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-03-07 10:45:31 +01:00
Álvaro Velad Galván 5debddcf4d chore: Add encrypted flag to init segments (#8182) 2025-02-27 14:10:32 +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 65da004a48 fix(DASH): ContentSteering promise is resolved too late for fetching of init segment (#8126)
Fixes: https://github.com/shaka-project/shaka-player/issues/8123
2025-02-20 11:21:02 +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 7fa6cde165 feat: Simplify updatePeriod config (#7980) 2025-01-29 16:43:13 +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
Álvaro Velad Galván 66ca230238 fix(DASH): Fix DASH_DUPLICATE_REPRESENTATION_ID error when using supplemental codec (#7961)
Fixes https://github.com/shaka-project/shaka-player/issues/7948
2025-01-28 10:44:17 +01:00
Wojciech Tyczyński 97832b7c45 chore: Stop using "Object" in DASH (#7947)
Related to #1672
2025-01-24 16:38:03 +01:00
theodab b9eabe5441 fix(DASH): Change fallback presentation delay (#7918)
Previously, if the presentation delay was not specified either by the
manifest or by configuration, we defaulted to 1.5 * minBufferTime. That
approach worked for most content, but in some cases it could cause live
streams to start out with a seekRangeEnd that was before the live edge.
This would lead to a brief pause in the beginning of the presentation,
while the live edge caught up.

This changes the DASH parser to use the segmentAvailabilityDuration if
it is lower than 1.5 * minBufferTime, which fixes that issue.

It also changes how that part of the code to be formatted, in order to
hopefully make the increasingly-complex logic for determining the
presentation delay more clear.
2025-01-22 10:43:08 +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
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
Álvaro Velad Galván 11afdc852c fix: Use getSegmentAvailabilityStart instead of getSeekRangeStart to evict segments (#7867) 2025-01-10 14:30:13 +01: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