Commit Graph

369 Commits

Author SHA1 Message Date
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
Álvaro Velad Galván e2413ed5f2 feat(HLS): Make dummy streams for tags representing muxed audio (#7343)
Close https://github.com/shaka-project/shaka-player/issues/5836
2024-09-20 23:58:56 +02:00
Álvaro Velad Galván 6532a7c605 fix(DASH): Fix HTTP redirect during manifest update (#7339)
Fixes https://github.com/shaka-project/shaka-player/issues/7323
2024-09-18 13:08:44 +02:00
Álvaro Velad Galván f8e3aa4b61 fix(DASH): Clear usedPeriodIds when period is removed from the manifest (#7305)
Issue https://github.com/shaka-project/shaka-player/issues/6239
2024-09-13 15:42:23 +02:00
Álvaro Velad Galván d559366168 perf(DASH): Delete old matchedStreams (#7301)
Issue: https://github.com/shaka-project/shaka-player/issues/6239
2024-09-13 11:48:41 +02:00
Álvaro Velad Galván da71e6d644 fix(DASH): Clear streamMap when period is removed from the manifest (#7297) 2024-09-13 10:37:54 +02:00
Wojciech Tyczyński 0023accf0f fix(DASH): Clone EventStream nodes to reduce memory consumption (#7285)
Fixes #7148
2024-09-11 13:00:05 +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 7b07614532 feat: Add manifest.disableIFrames config (#7255) 2024-09-04 16:14:13 +02:00
Álvaro Velad Galván 67859c987c feat(HLS): Add I-Frame playlist support (#7230) 2024-08-30 08:35:24 +02:00
Álvaro Velad Galván cb5aae47c0 feat(DASH): Support trick-mode per resolution (#7224) 2024-08-28 14:59:40 +02:00
Wojciech Tyczyński b2502fd0a0 fix(DASH): Fix MPD Patch when SegmentTemplate is shared between Representations (#7218)
Fixes #7214
2024-08-28 13:29:10 +02:00
Iragne c5df88b495 fix(DASH): Clear streamMap when period is removed from the manifest (#7202)
Related to https://github.com/shaka-project/shaka-player/issues/6239 and
https://github.com/shaka-project/shaka-player/issues/7148
Remove the reference to the stream when is no more needed.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2024-08-27 13:27:40 +02:00
Iragne 0f2cea42ee fix(DASH): Patch manifest Adaptationset indexing, @n=<Numbering> and @t=<time> (#7131)
Fixes https://github.com/shaka-project/shaka-player/issues/7128
2024-08-20 15:02:52 +02:00
theodab 5723a2bbe4 feat(preload): Add isPreload to net filter context (#7170)
Fixes #7160

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-08-19 23:50:20 -07:00
Álvaro Velad Galván a5adb39713 feat(DASH): Support Annex I: Flexible Insertion of URL Parameters (#7086)
Resolves https://github.com/shaka-project/shaka-player/issues/6472
2024-07-23 08:49:22 +02:00
Álvaro Velad Galván f9040ce2fb fix: Disable CC with disableText config (#7078) 2024-07-20 16:39:22 +02:00