8025 Commits

Author SHA1 Message Date
Álvaro Velad Galván f349d0a06e feat: Support ClearKey playback in Safari through WebCrypto (#10180)
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-06-12 11:47:43 +02:00
Wojciech Tyczyński 697816d3d9 perf: Disable ContentWorkarounds on Safari >=26.4 (#10204)
Since this version we don't need to fake encryption on audio segments.
2026-06-11 12:39:19 +02:00
Álvaro Velad Galván a92699fe4d fix(UI): Fix visibility of the ad statistics panel (#10203) 2026-06-11 10:40:06 +02:00
Álvaro Velad Galván 147d82b40c docs(UI): improve UI customization documentation (#10201) 2026-06-11 10:39:53 +02:00
Álvaro Velad Galván 1c63e75557 fix: Fix getOrInsertComputed is not available at the init, so not used at the init (#10202)
getOrInsertComputed is not available at init, until polyfills are used,
but the problem that this PR fixes is that there is a call that uses it
before calling the polyfill.
2026-06-11 10:39:27 +02:00
Álvaro Velad Galván 0f8f2edea2 test: migrate goog.Uri to URL API (#10196) 2026-06-09 20:51:39 +02:00
Álvaro Velad Galván 31a120bed5 fix(Ads): Prevent pre-roll ads if a previous ad has already played (#10195) 2026-06-09 14:38:37 +02:00
Álvaro Velad Galván 92298a6fb3 feat(Cast): Add setContentAlbumName to CastReceiver (#10189) 2026-06-09 14:38:24 +02:00
Álvaro Velad Galván a6cd599aa5 chore(Demo): Add new Apple assets (#10194) 2026-06-09 14:10:28 +02:00
Álvaro Velad Galván 47b3c0a04d fix(UI): Fix ad marker alignment regression (#10193)
Fixes a UI alignment bug where percentage-based ad markers and
interstitials were shifted horizontally. This regression was introduced
in PR #10097 due to how CSS handles 'background-position' when using
percentage values.

Now, the seek bar uses color stops within a full-width linear gradient
for dynamic percentage markers to guarantee exact boundaries, while
preserving the original centering logic for absolute-width chapter
markers.
2026-06-09 14:09:43 +02:00
Álvaro Velad Galván 378011fa4e refactor(Cast): Simplify CastProxy internals (#10187) 2026-06-08 15:17:37 +02:00
Álvaro Velad Galván b8982567b9 refactor(DASH): Simplify PeriodCombiner internals (#10188) 2026-06-08 15:15:09 +02:00
Álvaro Velad Galván 87a7d86daf feat: Add metadata extraction support for src= playback (#10112)
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
v5.1.8-main v5.0.19-main v4.16.35-main v4.15.47-main
2026-06-05 16:20:49 +02:00
Andy(김규회) e19c24d5c6 test(ABR): add SimpleAbrManager integration test suite (#10126)
Add integration tests for `SimpleAbrManager`.

Uses the same `StreamGenerator` class already used in other integration
tests to serve media segments from memory, avoiding unpredictable
network conditions. Throughput is simulated deterministically by
deriving each segment's download time from a target bitrate in
NetworkingEngine's onDownloaded callback.

Related #9918 , also adds integration tests for the dropped frame
protection feature. Since real frame drops can't be reproduced in test
environment, so used `getVidoePlaybackQuality` to override on the real
video element to inject controlled drop ratios.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 15:56:06 +02:00
Álvaro Velad Galván 4f62ce8b24 build: Reduce bundle size by deduplicating license headers (#10182)
Ensure generated bundles contain a single license header instead of
repeating the same notice across bundled modules.

Normalize all copyright years to 2016 and remove
duplicate license headers from generated bundles.

This reduces the final bundle size while preserving license information
in the distributed artifacts.
2026-06-05 12:43:28 +02:00
Álvaro Velad Galván c09ddc623d fix(MSF): Support MSF draft-1 and CMSF draft-1 (#10176) 2026-06-04 17:50:57 +02:00
Álvaro Velad Galván ee99146b0d chore: Update clearkeys assets (#10175) 2026-06-04 17:48:57 +02:00
Álvaro Velad Galván 68554911af test: Disable CastProxy tests on browsers without Proxy API (#10177) 2026-06-04 17:48:41 +02:00
Joey Parrish d02cf18fe2 ci: Work around macOS 15 Local Network Privacy (#10171)
macOS 15 (Sequoia) Local Network Privacy blocks the GUI test browser
from reaching lab hosts (the karma server) on the local subnet, failing
tests with net::ERR_ADDRESS_UNREACHABLE. The per-app permission cannot
be relied on: it is keyed to the Mach-O UUID of the browser binary, so
it is revoked on every Chrome update, there is no MDM or profile
control, and the node runs unattended.

Add a loopback HTTP CONNECT proxy that runs as a root LaunchDaemon. Root
daemons are exempt from Local Network Privacy, so the proxy can reach
lab hosts; the browser connects only to loopback (also exempt) via a
PAC, so it never needs the grant and survives Chrome updates. It uses
HTTP CONNECT rather than SOCKS because WebSocket over SOCKS fails with
ERR_WS_UPGRADE, and the karma control channel is a WebSocket.

See also https://github.com/shaka-project/shaka-lab/pull/84
2026-06-03 15:46:54 +02:00
Álvaro Velad Galván 38dca5a988 fix(Cast): Use cast platform APIs in MediaCapabilties polyfill (#10170) 2026-06-02 19:30:52 +02:00
Álvaro Velad Galván c306ac3501 feat(Cast): Dynamically proxy player and ad events using FakeEventTarget.ALL_EVENTS (#10168)
- Exposed and renamed `shaka.util.FakeEventTarget.ALL_EVENTS_` to
`ALL_EVENTS`, updating its value to `__shaka_all_events__` to prevent
string collisions.
- Refactored `CastProxy` and `CastReceiver` to subscribe directly to
this wildcard event for both the Player and the AdManager instances.
- Removed the hardcoded `shaka.cast.CastUtils.AdManagerEvents` array and
eliminated the loops that iterated over static event lists.

This makes the casting event proxy layer completely dynamic, cleaner,
and future-proof against new event additions to either the Player or the
AdManager.
2026-06-02 14:07:22 +02:00
Álvaro Velad Galván 85d0e5f5a2 refactor(Cast): use native Proxy API in CastProxy (#10169) 2026-06-02 14:07:05 +02:00
Álvaro Velad Galván 8daa8803f7 feat: Add throwOnPreloadNotSupported flag to preload() (#10163) 2026-06-02 09:51:31 +02:00
Álvaro Velad Galván 6e0599ab3e fix(Queue): Fix usage with RepeatMode.OFF (#10164)
According to the config description: "When the queue is completed the
media session is terminated".
2026-06-02 09:35:47 +02:00
Álvaro Velad Galván 240cc6300f chore(Demo): Fix moqlivemock namespaces (#10162) 2026-06-02 09:34:57 +02:00
Álvaro Velad Galván ad57ba820d feat(net): Add MIME type mappings for CMAF and Opus files (#10165) 2026-06-01 19:10:36 +02:00
Álvaro Velad Galván 821a639a1b fix(Queue): Support relative URLs in M3U playlists (#10161) 2026-06-01 17:00:56 +02:00
Matthias Van Parijs 2e509dad76 fix(preload): Restore adaptation on reused Player with preloaded variant (#10151)
`loadInner_` was skipping `chooseVariant_()` whenever a prefetched
variant was available.

Because `SimpleAbrManager.chooseVariant()` is the only place that sets
`lastTimeChosenMs_` (`trySuggestStreams` does that too but I doubt the
intent), the reused AbrManager (whose state was reset to `null` by
`stop()` during unload) never got reinitialized.

The guard in `segmentDownloaded` (`lastTimeChosenMs_ != null`) then
blocked every subsequent `suggestStreams_` call indefinitely.

This is an alternative fix that does not rely on `trySuggestStreams` (as
originally suggested by the issue report) but rather runs
`chooseVariant_()` unconditionally during load so the Player's
AbrManager always registers an initial selection. The prefetched variant
is still preferred for playback so prefetched segments aren't wasted.

Fixes #10045.
v5.1.7-main v5.0.18-main v4.16.34-main v4.15.46-main
2026-06-01 10:25:21 +02:00
Joey Parrish 154b837f2c feat(Demo): Replace Material Icons font with inline SVGs (#10156)
The player UI previously moved from a Material Design icons font to
inline SVGs, but the demo still loaded the "Material Icons Round" web
font from Google Fonts. Convert the demo to inline SVGs and drop the
font dependency.

- Add demo/icons.js: the SVG path data the demo needs plus a small
makeSvgIcon helper, mirroring shaka.ui.Icon but self-contained so the
demo does not depend on UI-internal classes.
- Convert the demo's own icon usages (config, input_container,
asset_card, custom, and the drawer close button in index.html) to inline
SVGs.
- Render MDL's drawer toggle button (a settings gear, set via MDL's
MENU_ICON) by appending an inline SVG to MDL's icon element in
setupPlayer_, instead of relying on the font.
- Remove the Google Fonts stylesheet link and the now-dead fonts.gstatic
preconnect from both demo HTML files, and drop the .material-icons
font-family override and line-height fix from demo.less.

Co-authored-by: Claude Code (Opus 4.8) <noreply@anthropic.com>
2026-06-01 09:39:14 +02:00
Álvaro Velad Galván 6562859506 feat(UI): Add modern CSS theme support using CSS custom properties (#10152)
The build system is updated to generate two CSS outputs:

A legacy stylesheet (.css) where CSS custom properties are flattened
using postcss-custom-properties for compatibility with older browsers. A
modern stylesheet (.modern.css) that preserves CSS custom properties for
modern browsers.

Both outputs are generated from the same LESS source and processed
through Autoprefixer and cssnano, ensuring consistent styling while
supporting different browser capabilities. This enables a gradual
migration path between legacy and modern UI styling without breaking
existing consumers.

Close https://github.com/shaka-project/shaka-player/issues/10145
2026-06-01 09:38:58 +02:00
Álvaro Velad Galván 814aaa718f refactor(UI): Avoid repeated localization.resolve calls (#10155) 2026-05-29 18:58:54 +02:00
Felipe 2e13ea2c41 fix(HLS): Fix LL-HLS stall on live playlist updates after #9998 (#10154)
Fixes https://github.com/shaka-project/shaka-player/issues/10149

PR #9998 (`perf(HLS): skip merging known segments on live playlist
updates`) introduced a regression where low-latency HLS live streams
stall after ~10 seconds of playback. The video and audio simply stop
with no error.

### Root Cause

`createSegments_()` keeps a `mediaSequenceToStartTime` map to track
which segments it has already seen. The optimization only passes **new**
segments (those not yet in the map) to `mergeAndEvict()`:

```js
// line 4838
if (isNewSegment) {
    newReferences.push(reference);
}
```

However, in LL-HLS, a segment's partial references **grow** across
playlist refreshes — e.g., a segment starts with 2 partials, then 4,
then 8, until the segment is complete. The `firstReferenceToCreate`
logic at line 4665 correctly detects segments with active partials and
triggers a **rebuild**, but the rebuilt reference is **not** included in
`newReferences` because its position already exists in
`mediaSequenceToStartTime`. So `mergeAndEvict()` never receives the
updated reference, the segment index retains **stale partial data**, and
the player stalls once it exhausts those stale partials — roughly 10
seconds of content.

### The Fix

**1 line, no behavioral impact on VOD or non-low-latency streams.**

```diff
- if (isNewSegment) {
+ if (isNewSegment || !isNewStream) {
```

During live updates (`isNewStream = false`), **all** rebuilt segments
are now passed to `mergeAndEvict`, not just the truly new ones. This is
correct because rebuilt segments (triggered by partials or EXTINF
changes) have updated content that must replace the stale data in the
segment index.

**No performance regression:** When there are truly no changes (all
segments known, no partials, no EXTINF changes),
`firstReferenceToCreate` stays at `hlsSegments.length`, so all segments
are skipped, `references` is empty, and `mergeAndEvict` is never called
— preserving the optimization.

### Steps to Reproduce

1. Play any LL-HLS live stream (e.g., with `#EXT-X-SERVER-CONTROL` and
partial segments)
2. Observe playback stops after ~8–12 seconds with no error
2026-05-29 14:01:39 +02:00
Álvaro Velad Galván 52e7da0be9 build(UI): Migrate CSS pipeline to PostCSS for prefixing and optimization (#10146)
- Add postcss-cli, autoprefixer, and cssnano to the build pipeline.
- Remove legacy '--clean-css' minification from the lessc step.
- Configure BROWSERSLIST env var for Chrome 38, Safari 8 and Firefox 42.
- Clean up redundant vendor prefixes (-webkit-, -moz-, etc.) from LESS
files.

Related to https://github.com/shaka-project/shaka-player/issues/10145
2026-05-28 21:27:26 +02:00
Álvaro Velad Galván 686d550a3a feat(UI): Modernize the statistics panel (#10144)
New design:
<img width="866" height="733" alt="Design"
src="https://github.com/user-attachments/assets/403c2ece-3ee0-46de-a310-a1f6adae8929"
/>
2026-05-28 20:45:43 +02:00
Shaka Translation Bot 98a197d689 chore: Update Sindarin (sjn) locale (#10148)
Generated from https://github.com/joeyparrish/shaka-sjn-translation.

Translations made with Claude Code and
https://github.com/joeyparrish/elvish-translation-tools.

Source strings last updated 2026-05-12 (Shaka Player commit
415ebdc52e).

Translation status: 70/70 strings translated.

Preview: https://joeyparrish.github.io/shaka-sjn-translation/

Co-authored-by: Shaka Translation Bot <278545291+shaka-translation-bot@users.noreply.github.com>
2026-05-28 09:47:29 -07:00
Álvaro Velad Galván 7108d22c34 feat(UI): Redesign Document PiP placeholder with blurred backdrop, pulse animation and label (#10140)
New design: 
<img width="1322" height="586" alt="Design"
src="https://github.com/user-attachments/assets/a3b057d4-9da7-4d3a-a39b-ab26b5253c4f"
/>
2026-05-28 18:00:04 +02:00
Joey Parrish d61c85edbc chore(Demo): Add back Tengwar font (#10147)
This adds back the Tengwar font to support an upcoming complete and
maintained translation into Sindarin, powered by Claude Code and
automated workflows.

This is even less invasive than the method I had originally. It does not
touch the library CSS at all.
2026-05-28 08:59:36 -07:00
Álvaro Velad Galván ee9436bd8a fix(UI): Update play button state on shaka.ads.Utils.AD_PLAYING (#10143) 2026-05-28 14:05:26 +02:00
Álvaro Velad Galván ad4b6245d3 fix(Cast): Proxy missing ad events through CastProxy (#10142) 2026-05-28 14:05:07 +02:00
Álvaro Velad Galván c433bcb68b feat(UI): Support Document PiP for audio-only playback (#10136) 2026-05-28 10:43:50 +02:00
Álvaro Velad Galván f2de74885e feat(UI): Update playback rate menu with slider and preset pills (#10134)
Before:

<img width="258" height="314" alt="before"
src="https://github.com/user-attachments/assets/07cdb649-aa99-4898-8a0c-262ff239e29d"
/>

After:

<img width="314" height="175" alt="after"
src="https://github.com/user-attachments/assets/fa150d58-8bcd-4e2f-8a80-bf4e7bf2abd3"
/>

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-05-28 10:34:48 +02:00
dependabot[bot] 61e64a9c2d build(deps): bump tmp from 0.2.4 to 0.2.7 (#10139) 2026-05-28 09:45:02 +02:00
Álvaro Velad Galván d295a0abff fix(UI): Sync Document PiP placeholder with video poster changes (#10135) 2026-05-28 09:42:02 +02:00
Joey Parrish 66ba6e3e5c fix(UI): Use consistent font throughout UI (#10138)
Force form elements (button, input, select, textarea) to inherit
font-family, since browsers default them to the OS system font rather
than inheriting from ancestors. This makes the Shaka UI font apply
consistently to all elements under .shaka-video-container.

Remove now-redundant explicit font-family declarations from
.shaka-overflow-quality-mark and the tooltip ::after pseudo-element,
which were workarounds for the same inheritance gap.

Now it is possible for an application to override the font style of the
UI with a single declaration.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 06:27:01 +02:00
Joey Parrish 1841e3a5f1 fix(demo): Re-enable lazy localization (#10137)
If you open Shaka Player with Hungarian as the UI language setting
(https://shaka-project.github.io/shaka-player-release/demo/#uilang=hu)
it will currently display the UI in English, because Hungarian is not
one of the built-in-by-default languages for the project. It does still
work for a built-in language like German. (Compare to
https://shaka-project.github.io/shaka-player-release/demo/#uilang=de)

We used to have a feature in the demo to load localizations from the
server dynamically for languages where we have translations, but don't
build them in by default.

The feature to lazy-load localizations for the player UI was
acccidentally dropped in e8e2807 (PR #5665) while abandoning translation
of the demo itself. This PR restores that feature in a simplified
implementation. Ex:
https://joeyparrish.github.io/shaka-player/demo/#uilang=hu
2026-05-28 06:25:06 +02:00
Ivan 921206dc1d feat: transmux in a worker (#9914)
This PR introduces a Web Worker for transmuxing resolving
https://github.com/shaka-project/shaka-player/issues/1735

- The worker bundle is compiled separately
- The build output is embedded as a string constant and then wrapped in
a Blob to create an inline Worker URL (HLS.js does this very similarly)
- `TransmuxerProxy` is created wrapping a real transmuxer, but no worker
is started yet - on the first `transmux()` call, it checks if the device
supports worker transmuxing
- For each transmux() call: the buffer is copied, then zero-copy
transferred to the worker. A PublicPromise is stored under a reqId with
a timeout timer, and the main thread awaits it.
- The worker transmuxes and posts back transmuxed (or error). The shared
message listener routes the response to the right proxy instance by id,
which resolves the promise and cancels the timer.
- When the last proxy instance is destroyed, the worker is terminated
and the blob URL is revoked.
  loaded inside the worker.
- Some low-end devices have been excluded since their Worker support is
questionable

There most likely is a better way to do this - please let me know
2026-05-27 21:51:03 +02:00
Álvaro Velad Galván ad8b674784 refactor: Improve code of NativeTextDisplayer (#10106)
Improve readability and separate responsibilities. Use Intl.DisplayNames
when available and fallback to mozilla.LanguageMapping otherwise.

Note: this is in preparation for addressing
https://github.com/shaka-project/shaka-player/issues/9694

---------

Co-authored-by: Matthias Van Parijs <matvp91@gmail.com>
2026-05-27 14:43:58 +02:00
Álvaro Velad Galván a479eae58b fix: Emit ratechange event when playbackRate stays at 0 (#10130)
This can happen when using playbackRate values ​​that are outside the
range supported by the platform, and we have to use our internal
alternative. See the implementation at
https://github.com/shaka-project/shaka-player/blob/main/lib/media/play_rate_controller.js
2026-05-27 14:19:32 +02:00
Álvaro Velad Galván f367ee5ffa feat(Queue): Add M3U playlist loading support (#10115) 2026-05-27 13:29:19 +02:00
Álvaro Velad Galván 1b41275415 refactor(UI): Unify localization and availability updates in Element (#10128) 2026-05-27 10:02:29 +02:00