Commit Graph

4854 Commits

Author SHA1 Message Date
Álvaro Velad Galván 3c45ae007f feat(UI): Show chapter images on seek bar hover if there are no thumbnails (#9741) 2026-02-23 11:28:49 +01:00
Álvaro Velad Galván e59b8b40a7 feat(HLS): Add chapter images (#9738)
Spec:
https://developer.apple.com/documentation/http-live-streaming/providing-javascript-object-notation-json-chapters
2026-02-20 15:04:12 +01:00
Álvaro Velad Galván 88c65c6bbf chore: Reduce the internal complexity of the chapters (#9737)
Instead of saving chapter titles as a URL, they are now saved as a
metadata section that can be expanded in the future.
2026-02-20 11:38:33 +01:00
Andy(김규회) c7368024ae feat: Select default track by a list of preferences (#9542)
I went ahead and implemented the full structured preference system that
was discussed in
https://github.com/shaka-project/shaka-player/issues/1591.
Instead of just expanding languages to arrays, I replaced all 14
individual preference fields with 3 structured arrays:

```tsx
  preferredAudio (language, role, label, channelCount, codec, spatialAudio)
  preferredText (language, role, format, forced)
  preferredVideo (label, role, codec, hdrLevel, layout)
```

Each array entry works as an AND filter - so you can say things like "I
want Korean with 5.1 surround, but if not available, English is fine
too":

```tsx
player.configure('preferredAudio', [
  {language: 'ko', channelCount: 6},
  {language: 'ko'},
  {language: 'en'},
]);
```

<img width="1728" height="965" alt="image"
src="https://github.com/user-attachments/assets/7b088150-139b-475e-bdba-5bc77dd4e524"
/>

**Config** - Replaced the 14 individual fields with 3 arrays of typed
preference objects (AudioPreference, TextPreference, VideoPreference).
The old fields still work at runtime with a deprecation warning, so
existing apps won't break immediately.

**Demo** - The demo config UI now shows inline expandable preference
lists instead of flat text inputs. You can add/remove entries and
configure each field per entry. URL hash serialization was updated to
use JSON format, with legacy param fallbacks preserved.
2026-02-20 10:12:08 +01:00
Álvaro Velad Galván ab09d4dcd7 fix: Do not update the player position with negative playback rates if the video is paused (#9732) 2026-02-20 10:01:37 +01:00
Álvaro Velad Galván 992f2158e5 chore: Remove shaka.media.IClosedCaptionParser interface (#9731) 2026-02-20 09:58:09 +01:00
Álvaro Velad Galván 42a88bcfaa feat: Remove testing of MSS support (#9733) 2026-02-20 09:52:29 +01:00
gmamzn 548fe2953e fix(TTML): Update position alignment map (#9735)
Map 'start' to 'LEFT' and 'end' to 'RIGHT'
This mapping needs to be reversed for RTL languages.
2026-02-19 14:30:23 -08:00
Álvaro Velad Galván 6826ffa311 feat(CEA): Implement raw CEA-608 packet extraction (#9730)
This format is generated by Apple's HLS tools.
2026-02-19 11:45:18 +01:00
Álvaro Velad Galván 0a2ff0fe5f chore: Improve device type and browser engine detection (#9727) 2026-02-18 13:38:08 +01:00
Álvaro Velad Galván ff7cea5b96 fix(net): Avoid duplicate progressUpdated in HttpXHRPlugin onload (#9726) 2026-02-18 12:28:29 +01:00
Álvaro Velad Galván 20c0758e11 refactor(net): Improve DataUriPlugin parsing logic (#9724)
- Replace split(':') with startsWith('data:') for scheme validation
- Use indexOf(',') instead of split(',') to avoid unnecessary
allocations
- Remove window dependency from decodeURIComponent
- Normalize base64 detection using toLowerCase()
2026-02-17 13:44:56 +01:00
Álvaro Velad Galván 5abd49cd82 feat: Add requestType and context to download events (#9723)
Close https://github.com/shaka-project/shaka-player/issues/9408
2026-02-17 12:43:26 +01:00
Álvaro Velad Galván 1139a4e42c fix(UITextDisplayer): avoid ResizeObserver loop warning (#9722)
UITextDisplayer was triggering:

  "ResizeObserver loop completed with undelivered notifications"

This happened because updateCaptions_() mutates the DOM inside the
ResizeObserver callback, which can cause synchronous layout feedback
loops.

This change:

- Observes videoContainer_ instead of textContainer_
- Defers updateCaptions_() using requestAnimationFrame
- Coalesces multiple resize events using a pendingResize_ flag
- Ensures updates only run when captions are visible

This prevents layout feedback loops while preserving correct caption
re-rendering behavior.

Fixes https://github.com/shaka-project/shaka-player/issues/9721
2026-02-17 11:03:18 +01:00
Álvaro Velad Galván 56ac70d44a perf(S2T): Improve SpeechToText code (#9718)
Avoid race conditions when using Translator API.
Avoid unnecessary DOM mutations.
Separate responsibilities in the code.
2026-02-17 10:07:29 +01:00
Álvaro Velad Galván 08eb22ffd4 fix(HLS): Support external chapters (chaptersUri config) when load a Media Playlist (#9720) 2026-02-17 09:58:55 +01:00
Álvaro Velad Galván 48b553a595 fix(MSF): Fix CMSF catalog parsing (#9710)
It's better use the packaging instead of the mimetype to check the
compatibility
2026-02-13 16:16:22 +01:00
Álvaro Velad Galván 02f579fe22 feat: Add HDR and screen size detection on Titan OS (#9700) 2026-02-12 13:33:54 +01:00
Álvaro Velad Galván e57a5091f0 fix: Validate that mediaElement.getStartDate returns a Date (#9701)
Fixes https://github.com/shaka-project/shaka-player/issues/9672
2026-02-11 18:19:41 +01:00
Álvaro Velad Galván 5c8ffe4565 fix: Fix video freezes when seeking to the end when the audio and video duration are slightly different (#9695)
Fixes https://github.com/shaka-project/shaka-player/issues/9673
2026-02-11 15:26:40 +01:00
Álvaro Velad Galván 59f38310a3 fix: Fix usage of mediaElement in shaka.Player constructor (#9698)
This should have been removed in version 5, but we did it wrong, so we
have to add it back.

I'm removing the deprecated log and throwing an `alwaysWarn` because
this change could break many more applications than we want, given that
the second parameter is `videoContainer` and we could do something
wrong.
2026-02-11 13:24:32 +01:00
Álvaro Velad Galván f8abc76dcf docs: Fix NO_VIDEO_ELEMENT doc on v5 (#9697) 2026-02-11 13:16:48 +01:00
Álvaro Velad Galván 123d665e39 feat: Add basic support to Titan OS (#9696)
User Agent info: https://docs.titanos.tv/user-agents
2026-02-11 12:43:41 +01:00
Álvaro Velad Galván 9cef117f4e feat: Remove com.widevine.alpha.experiment from probeSupport (#9687)
https://chromium-review.googlesource.com/c/chromium/src/+/7552797
2026-02-09 17:06:26 +01:00
Álvaro Velad Galván f9ce5ce3cb fix: Allow MSE ended in canPerformOperations_ (#9683)
Fixes https://github.com/shaka-project/shaka-player/issues/9681
2026-02-09 10:22:02 +01:00
Álvaro Velad Galván 943a5f5e97 feat(HLS): Add CAN-SKIP-DATERANGES support (#9679)
Co-authored-by: Theodore Abshire <TheodoreAbshire@Gmail.com>
2026-02-09 09:47:00 +01:00
Shaka Bot 12aeb5b35a chore(main): release 5.0.0 (#9028) 2026-02-06 13:05:17 +01:00
Álvaro Velad Galván ebcf0feb98 fix: Correctly destroy enqueue blocking operations (#9677)
Fixes https://github.com/shaka-project/shaka-player/issues/9639
2026-02-06 11:27:38 +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
Álvaro Velad Galván a10287e3f0 feat!: Require apps to call updateStartTime instead of setting media element currentTime directly during startup (#9668)
This change is feat! because it no longer allows modifying the
`currentTime` of the mediaElement in the streaming event. With this
change, only `updateStartTime` can be called to update the time, and the
user should always use the `canupdatestarttime` event instead of
`streaming` event when they need it.

Fixes https://github.com/shaka-project/shaka-player/issues/9661
2026-02-05 20:26:33 +01:00
Matthias Van Parijs 2db6038e74 feat!: Remove setTextTrackVisibility from the public API (#9664)
We previously deprecated setTextTrackVisibility, this PR removes it from
the public API.

This'll allow us to further strip down the distinction between selecting
a text track and toggling its visibility internally. Atleast we'll no
longer have users rely on this API from v5 onwards.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-02-05 15:39:50 +01:00
Andy(김규회) d98169bc25 feat(EME): Add retryLicensing() and failureCallback for manual license retry (#9638)
So basically, when a license request fails (eg. network Error, server
down whatever), apps can now retry from scratch by calling
`player.retryLicensing()`. This was tricky to implement because of EME
spec limitations: `generateRequest()` can only be called once per
session. So if it fails, it would be stuck.

So I close the old session and create a brand new one with the same
`initData`

> Will Video element throw an error during this process?

we were worried that closing the session would leave the video without
keys for a brief moment, potentially triggering errors. But in practice,
the transition is fast enough( I added a 0.1s delay for CDM clean up)
and the video element handles it gracefully

> Will new encrypted event fire? If not, will it limit this feature?

The encrypted event only fires when the browser first encounters
encrypted content. When we close and recreate a session, the content is
already loaded, so no new event

Solutions: In `CreateSession()` metadata store `initData` and
`initDataType` in the session metadata when the session is first
created. So when `retryLicensing()`is called, we just grab the stored
data and pass it to `generateRequest()` on the new session. No need to
wait for an `encrypted` event at all.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-02-05 14:12:30 +01:00
Álvaro Velad Galván c200219fa2 test: Fix UI tests on SmartTVs (#9660)
Tests fixed:

```
  UI Customization
    ✗ big buttons only created when configured [Safari 3.0 (Tizen 3.0)]
	Error: Expected 1 to be 0.
	    at <Jasmine>
	    at Function.confirmElementMissing (test/test/util/ui_utils.js:70:29 <- test/test/util/ui_utils.js:139:31)
	    at _callee6$ (test/ui/ui_customization_unit.js:86:13 <- test/ui/ui_customization_unit.js:152:21)
	    at tryCatch (node_modules/@babel/polyfill/dist/polyfill.js:6473:40)
  UI
    controls
      controls-button-panel
        ✗ has default elements [Safari 3.0 (Tizen 3.0)]
	Error: Expected 1 to be 0.
	    at <Jasmine>
	    at Function.confirmElementMissing (test/test/util/ui_utils.js:70:29 <- test/test/util/ui_utils.js:139:31)
	    at _callee15$ (test/ui/ui_unit.js:425:19 <- test/ui/ui_unit.js:506:27)
	    at tryCatch (node_modules/@babel/polyfill/dist/polyfill.js:6473:40)

```
2026-02-05 07:09:13 +01:00
Álvaro Velad Galván 2562fcbb5c perf: Improve startup performance of LiveSeekableRange operations (#9665)
Fixes https://github.com/shaka-project/shaka-player/issues/9639
2026-02-05 07:08:51 +01:00
Álvaro Velad Galván dbcf5ace7b perf(Ads): Detect earlier initial preloadError in order to increase the performance when using supportsMultipleMediaElements = false (#9666)
Related to https://github.com/shaka-project/shaka-player/pull/9612
2026-02-05 07:07:58 +01:00
Álvaro Velad Galván fd834897aa fix: Setup correct video codecs on MSE (#9667)
Convert avc1 codec string from RFC-4281 to RFC-6381 
Example, convert avc1.66.30 to avc1.42001e
2026-02-04 21:29:01 +01:00
Álvaro Velad Galván bd167c3744 feat: Add listenMulti and listenOnceMulti to shaka.util.EventManager (#9652)
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-02-03 21:49:35 +01:00
Álvaro Velad Galván b6a73d4ba5 fix: Make clearLiveSeekableRange more robust (#9649)
Fixes https://github.com/shaka-project/shaka-player/issues/9639
2026-02-03 10:48:52 +01:00
Álvaro Velad Galván 5c013ebdec fix: Make setLiveSeekableRange more robust (#9641)
Fixes https://github.com/shaka-project/shaka-player/issues/9639
2026-02-02 16:54:34 +01:00
Álvaro Velad Galván 9fd0be10ad fix: Fix startAtSegmentBoundary config when using a live stream (#9640)
Fixes https://github.com/shaka-project/shaka-player/issues/9637
2026-02-02 12:52:20 +01:00
Álvaro Velad Galván 6fc70622eb chore: Change frameRate from string to number in shaka.media.SegmentUtils.BasicInfo (#9627)
Related to https://github.com/shaka-project/shaka-player/pull/9626
2026-01-29 17:13:20 +01:00
Álvaro Velad Galván 9de4a9849f fix: Dispatch metadata events when stream is paused and the user seeks (#9628) 2026-01-29 16:00:20 +01:00
Álvaro Velad Galván afd24224ce feat(SRT): Improve SRT to WebVTT conversion and color handling (#9624)
- Full SRT → WebVTT conversion now supports timestamps, alignment,
position, and basic styles (bold, italic, underline).
- Added proper handling for <font color="..."> tags:
  - Converts known colors to WebVTT <c.color> classes.
  - Safely removes unknown colors without leaving orphaned </c> tags.
- Supports Aegisub cues ({\anX} → line & align, {\pos(x,y)} → position &
line).
- Normalizes timestamps (MM:SS,mmm → 00:MM:SS.mmm) for WebVTT
compliance.
2026-01-29 12:39:38 +01:00
Álvaro Velad Galván 674e71d064 fix(Ads): Harden MediaTailorAdManager state and cuepoint handling (#9619)
This change improves MediaTailor ad handling by:
- Deduplicating cue points to avoid repeated ad markers
- Guarding ad break listener setup to prevent event duplication
- Cleaning up ad state more defensively on stop/end
- Improving static resource caching and tracking robustness

These fixes prevent duplicate events, listener leaks, and inconsistent
ad playback during manifest updates and polling.

---------

Co-authored-by: Theodore Abshire <TheodoreAbshire@Gmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-01-29 12:39:14 +01:00
Álvaro Velad Galván 1debeb8640 feat: Derive frameRate from fMP4 samples and improve MP4 parsing in SegmentUtils (#9626)
- Calculate frameRate using tfhd/trun in fMP4
- Concatenate initData and media data for parsing
- Deduplicate PSSH boxes across initData and segments
2026-01-29 11:51:26 +01:00
Álvaro Velad Galván 7a171c6217 chore(Queue): Improve the QueueManager code (#9620) 2026-01-29 09:50:09 +01:00
Álvaro Velad Galván 793749a6e2 perf: Minor performance optimizations in TXml text processing and root lookup (#9622)
- Avoid repeated split() when matching expected root element names
- Improve text content concatenation to reduce string allocations
- Remove unnecessary Array.from() usage when checking text-only children
2026-01-28 19:08:09 +01:00
Álvaro Velad Galván 7faa3864a7 perf(ABR): Minor performance optimization in EWMA alpha calculation (#9623) 2026-01-28 19:07:48 +01:00
Romualdas Paskevicius dde661f12d fix(LCEVC): Return early if playerInterface object is destroyed (#9621)
In LCEVC scalable delivery (dual-track) mode, return early if the
`playerInterface` object is destroyed. This is useful in case
`playerInterface` is destroyed during the `await` call.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-01-28 16:46:46 +01:00
Álvaro Velad Galván eefc8c2726 fix(Ads): Handle bad HTTP status errors as specified, play main content (#9612)
Fixes https://github.com/shaka-project/shaka-player/issues/9607

More info:
https://mailarchive.ietf.org/arch/msg/hls-interest/ev-q7Q7sH5ADz4NgKxqSeCnE2IQ/
2026-01-28 11:20:44 +01:00