Commit Graph

8 Commits

Author SHA1 Message Date
Álvaro Velad Galván c6e6082bc2 feat: Allow override subtitle position (#9522)
Close https://github.com/shaka-project/shaka-player/issues/9521

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-12-19 13:38:33 +01:00
Matthias Van Parijs 73ee27bf17 feat!: Remove autoShowText and simplify initial text track selection (#9435)
This is the first step in a series of efforts to simplify how we handle
text tracks internally.

The purpose of `autoShowText` has always felt a bit unclear. It was
originally added because Shaka wasn't flexible enough when choosing an
initial text track. I don't think we should try to handle every possible
scenario for initial text track selection. Instead, we should respect
`config.preferredTextLanguage` and let the application decide if it
needs more granular control. Apps can already do this easily with
`getTextTracks()` and `selectTextTrack(track)`.

Ultimately, I'd like to move toward a simpler API where either a text
track is selected or none is. If nothing is selected, we shouldn't
stream any text at all.

See https://github.com/shaka-project/shaka-player/issues/9301 for extra
context.
2025-12-12 09:41:15 +01:00
Álvaro Velad Galván 3daeac65cd feat: Add queue manager (#8649)
Close #8508

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-05-29 12:41:30 +02:00
Álvaro Velad Galván 3c60254c1b fix: Add new crossBoundaryStrategy for Apple browsers (#8345)
Related to https://github.com/shaka-project/shaka-player/issues/8335
2025-03-27 11:29:45 +01: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
Wojciech Tyczyński f718139810 fix: Do not minify CodecSwitchingStrategy enum keys (#7200)
Enum keys has been minified in release build.
As comments were using wrong syntax, they weren't displayed in
documentation.
2024-08-23 15:16:26 +02:00
Dave Nicholas 0078137d1b feat: Enable codec switching (#5470)
Closes: https://github.com/shaka-project/shaka-player/issues/1528
Closes: https://github.com/shaka-project/shaka-player/issues/1567
Closes: https://github.com/shaka-project/shaka-player/issues/4379
Closes: https://github.com/shaka-project/shaka-player/issues/5306

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2023-10-04 08:37:14 +02:00
Vincent Valot 5c24410560 feat: New autoShowText config to change initial text visibility behavior (#3421)
Adds a new autoShowText config to allow apps to choose the behavior of text visibility on startup.

The default is the old behavior (`AutoShowText.IF_SUBTITLES_MAY_BE_NEEDED`), which is to auto-enabled text only if we think subtitles may be needed.  This is when the user's preferred audio language is unavailable, but the preferred text language **is** available.

A new option has been added (`AutoShowText.IF_PREFERRED_TEXT_LANGUAGE`) that will only consider the user's preferred text language.  If a match is found, text is visible on startup.

Finally, we add two additional options that are extremely simple: `AutoShowText.ALWAYS` and `AutoShowText.NEVER`.  Applications that want complete control over text visibility without any "smart" choices made by the player can use these options.

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2022-09-21 10:53:52 -07:00