Commit Graph

385 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
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
Á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
Iragne 0ca6ff7ae6 fix(DASH): Error due to deleted stream (#7723)
Fixes https://github.com/shaka-project/shaka-player/issues/7722
2024-12-09 10:14:12 +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 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
Iragne 2d14dd5480 fix(DASH): Live to vod transition (#7404)
The PR is solving playback error in a Multi period manifest when the
start time is not 0.
Additionally, solving the error code 3015 due to the clear of the buffer
during the playback.
Fixes https://github.com/shaka-project/shaka-player/issues/7401
2024-10-15 12:49:38 +02:00