@vestra-player/sdk 1.11.0-rc.4 → 1.11.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -4
- package/dist/docs-tree.json.gz +0 -0
- package/dist/plugin/connection.d.ts +10 -7
- package/dist/plugin/connection.js +10 -9
- package/dist/plugin/player.d.ts +3 -3
- package/dist/plugin/player.js +3 -3
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## 1.11.0
|
|
4
4
|
|
|
5
|
-
**The second batch of events, no capability disclosure, and the built-in-only refusal renamed** (user rulings 2026-11-16 and 2026-11-21). Plugins have no capabilities, neither as declarations (gone since 1.9.0) nor as a disclosure: the name-based scan and its table are removed, and the plugin store no longer shows what a plugin's code uses. The player's real API boundaries stay (request validation and the built-in-only requests); their refusal now has the code `builtin-only`. Breaking, released as a minor without an alias, since every plugin is the project's own (ruling 2026-11-21). Who must change: a tool that runs `vestra-plugin scan` or reads `@vestra-player/sdk/capability-scan.json`, and a plugin that compares `error.code` for a built-in-only call (below).
|
|
5
|
+
**The second batch of events, no capability disclosure, and the built-in-only refusal renamed** (user rulings 2026-11-16 and 2026-11-21). Plugins have no capabilities, neither as declarations (gone since 1.9.0) nor as a disclosure: the name-based scan and its table are removed, and the plugin store no longer shows what a plugin's code uses. The player's real API boundaries stay (request validation and the built-in-only requests); their refusal now has the code `builtin-only`. Breaking, released as a minor without an alias, since every plugin is the project's own (ruling 2026-11-21). Who must change: a plugin that calls `player.subscribe()` or `player.onChange()`, a tool that runs `vestra-plugin scan` or reads `@vestra-player/sdk/capability-scan.json`, and a plugin that compares `error.code` for a built-in-only call (below).
|
|
6
6
|
|
|
7
7
|
**The second batch of events** (needs the player version that sends them, 0.11):
|
|
8
8
|
|
|
9
9
|
- **Fact events** (new, `FactEvent` and `FactEventPayloads`, a third overload of `player.on`): `video.reconfigured` (`{ sourceId, width, height, displayWidth, displayHeight, fps, rotation, hdr }`), `audio.reconfigured` (`{ sourceId, sampleRate, channels, format }`), `audio.tracks.changed` (`{ sourceId, audioTracks }`, as `AudioTrack`s), `subtitles.changed` (`{ state }`, a `SubtitlesState`, taken into `plugin.subtitles.state` first), `window.changed` (a `WindowState`, taken into `plugin.window.state` first; a resize once it has settled for 300 ms), `layout.changed` (`{ slots }`, each position with its panels, `LayoutPosition`), `audio.devices.changed` (`{ devices, requested, active }`) and `app.started` (`{ version, previous }`). Each is sent once per change; a listener of one does not keep the plugin running, and the player wakes a plugin in standby for it.
|
|
10
|
-
- **The copies take a fact first
|
|
10
|
+
- **The copies take a fact first**: `subtitles.changed` into `plugin.subtitles.state`, `window.changed` into `plugin.window.state`, `layout.changed` into the panel layout, `audio.tracks.changed` into `plugin.player.state.audioTracks` (when it is the copy's source) and `audio.devices.changed` into `plugin.player.state.audioOutput`, so the copy holds it when the listener runs and a binding that reads it runs again.
|
|
11
11
|
- Removed `Player.subscribe()` and `Player.onChange()`.
|
|
12
12
|
- **An event reaches a plugin from its first listener.** `source.state`, `playback.backend`, `window.state`, `timeline.changed`, `appearance.changed` and `resolvers.fileTypes` are subscribed while a listener, a watcher (`MainWindow.onChange`, a panel slot's `onChange`, `Subtitles.onChange`, a media handle's `ready` and `onEnd`, a scrub) or a stream holds them; the SDK's own copy and a binding's read never subscribe them on their own, so a bound value or a command state that reads `plugin.player.state` shows the newest snapshot the plugin has. `Media.ready` no longer polls the state every 100 ms.
|
|
13
|
-
- **Following the source is not listening
|
|
14
|
-
- **No request after `runtime.stop`**: once the player sent `runtime.stop`, every request of the plugin is refused with `disabled` and not sent, the plugin's own cleanup included (the player's runner refused them already). In `TestHost` the cleanup requests at a plugin's stop (and at `park()` and `upgrade()`) are therefore no longer sent, and the test host revokes what the run held itself, as the player does
|
|
13
|
+
- **Following the source is not listening**: `plugin.video.view()`, a shader channel (`plugin.video.shaders(id)`) and a processing node (`plugin.video.filter`, `plugin.audio.filter`) send their values again when the source changes, so they follow `source.state`, but they do not count as a listener of it: the player is told the SDK's copy (`mirror`), and a plugin is never classified as "listening to source.state" because of such a handle. What the handle holds keeps the plugin running, with its own reason: the display layer from the moment it is made, a filter chain once it has nodes, a shader channel once it has shaders. `Media.ready`, `Media.onEnd` and a scrub count as listeners: they serve the plugin's own wait, callback or gesture. A binding or a command's function field that reads a state never makes the plugin a listener, not even while such a handle keeps the event subscribed; its reason joins what the player is told only while a real listener or stream listens. (The `theme-widgets` example's trace: its view's bind of `plugin.commands.keys` subscribes as the SDK's copy.)
|
|
14
|
+
- **No request after `runtime.stop`**: once the player sent `runtime.stop`, every request of the plugin is refused with `disabled` and not sent, the plugin's own cleanup included (the player's runner refused them already). In `TestHost` the cleanup requests at a plugin's stop (and at `park()` and `upgrade()`) are therefore no longer sent, and the test host revokes what the run held itself, as the player does at each kind of stop: at every stop its windows, panels, commands, settings pages, resolvers, sequence provider, streams, filter chains, display layer, render options and shaders; its timeline layer, always-on-top and cursor settings stay through `park()` (an idle stop) and go at every other stop (disable, a fault, uninstall, reload, `upgrade()`, quit, or `stop()` without a reason).
|
|
15
15
|
- **`TestHost`** sends the fact events by the player's rules: `audio.tracks.changed` after a source change, `window.changed` and `layout.changed` after a `window.state`, `subtitles.changed` and `audio.devices.changed` after a request or an event changed them, and `video.reconfigured` and `audio.reconfigured` from `host.stats` when a source becomes ready. `app.started` is sent with `host.emit`.
|
|
16
16
|
|
|
17
17
|
**No capability disclosure:**
|
package/dist/docs-tree.json.gz
CHANGED
|
Binary file
|
|
@@ -172,7 +172,7 @@ export declare class Connection {
|
|
|
172
172
|
*/
|
|
173
173
|
hold(event: string, why?: Why, always?: boolean): Disposable;
|
|
174
174
|
/**
|
|
175
|
-
* The SDK's own follower of `event
|
|
175
|
+
* The SDK's own follower of `event`: a handle that sends
|
|
176
176
|
* its values again when the source changes (`plugin.video.view()`, a
|
|
177
177
|
* shader channel, a processing node). It subscribes a held-only group
|
|
178
178
|
* while it lives, as {@link Connection.hold} does, but counts as the SDK's
|
|
@@ -188,12 +188,15 @@ export declare class Connection {
|
|
|
188
188
|
*/
|
|
189
189
|
follow(event: string, why?: Why): Disposable;
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
191
|
+
* A binding (or a command's function field) reads `event`'s state: its
|
|
192
|
+
* reason joins what the player is told while a plugin listener, hold or
|
|
193
|
+
* stream listens to the group, but the read never makes the plugin a
|
|
194
|
+
* listener on its own, whether or not the group is subscribed (by a
|
|
195
|
+
* handle that follows the source, {@link Connection.track}). It never
|
|
196
|
+
* subscribes a held-only group either: a bound value that reads
|
|
197
|
+
* `plugin.player.state` shows the newest snapshot the plugin has; a stream
|
|
198
|
+
* or an event makes it follow the player. Nothing when nothing started
|
|
199
|
+
* the group.
|
|
197
200
|
*/
|
|
198
201
|
bindingReads(event: string, why: Why): Disposable;
|
|
199
202
|
/**
|
|
@@ -426,7 +426,7 @@ export class Connection {
|
|
|
426
426
|
return this.#hold(event, why, always ? "always" : "read");
|
|
427
427
|
}
|
|
428
428
|
/**
|
|
429
|
-
* The SDK's own follower of `event
|
|
429
|
+
* The SDK's own follower of `event`: a handle that sends
|
|
430
430
|
* its values again when the source changes (`plugin.video.view()`, a
|
|
431
431
|
* shader channel, a processing node). It subscribes a held-only group
|
|
432
432
|
* while it lives, as {@link Connection.hold} does, but counts as the SDK's
|
|
@@ -472,18 +472,20 @@ export class Connection {
|
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
475
|
+
* A binding (or a command's function field) reads `event`'s state: its
|
|
476
|
+
* reason joins what the player is told while a plugin listener, hold or
|
|
477
|
+
* stream listens to the group, but the read never makes the plugin a
|
|
478
|
+
* listener on its own, whether or not the group is subscribed (by a
|
|
479
|
+
* handle that follows the source, {@link Connection.track}). It never
|
|
480
|
+
* subscribes a held-only group either: a bound value that reads
|
|
481
|
+
* `plugin.player.state` shows the newest snapshot the plugin has; a stream
|
|
482
|
+
* or an event makes it follow the player. Nothing when nothing started
|
|
483
|
+
* the group.
|
|
481
484
|
*/
|
|
482
485
|
bindingReads(event, why) {
|
|
483
486
|
const group = this.#events.get(event);
|
|
484
487
|
if (!group)
|
|
485
488
|
return { dispose: async () => { } };
|
|
486
|
-
group.active++;
|
|
487
489
|
const token = {};
|
|
488
490
|
group.whys.set(token, why);
|
|
489
491
|
this.#tell(event, group);
|
|
@@ -493,7 +495,6 @@ export class Connection {
|
|
|
493
495
|
if (!reading)
|
|
494
496
|
return;
|
|
495
497
|
reading = false;
|
|
496
|
-
group.active--;
|
|
497
498
|
group.whys.delete(token);
|
|
498
499
|
if (this.#events.get(event) === group)
|
|
499
500
|
this.#tell(event, group);
|
package/dist/plugin/player.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare class PlayerService implements StreamSource {
|
|
|
72
72
|
* more when the subscription starts, also without `read()`.
|
|
73
73
|
*/
|
|
74
74
|
/**
|
|
75
|
-
* A fact event's fields of the state
|
|
75
|
+
* A fact event's fields of the state: taken into the copy
|
|
76
76
|
* when `belongs` holds for it, as `accept` takes a state (a precise
|
|
77
77
|
* pass for the fields that changed); its event sequence is kept, so the
|
|
78
78
|
* next `source.state` is accepted as before.
|
|
@@ -120,14 +120,14 @@ export declare class PlayerService implements StreamSource {
|
|
|
120
120
|
/**
|
|
121
121
|
* `audio.tracks.changed`'s data as the listener gets it (`ScopeImpl.fact`,
|
|
122
122
|
* SDK 1.11.0): the tracks as {@link PlayerState.audioTracks} lists them.
|
|
123
|
-
* The copy takes them first
|
|
123
|
+
* The copy takes them first, when they are of its source.
|
|
124
124
|
*/
|
|
125
125
|
export declare function audioTracksChanged(runtime: Runtime, data: unknown): {
|
|
126
126
|
sourceId: number;
|
|
127
127
|
audioTracks: AudioTrack[];
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
|
-
* `audio.devices.changed`'s data as the listener gets it
|
|
130
|
+
* `audio.devices.changed`'s data as the listener gets it:
|
|
131
131
|
* as the player sent it; the copy takes `requested` and `active` into
|
|
132
132
|
* {@link PlayerState.audioOutput} first.
|
|
133
133
|
*/
|
package/dist/plugin/player.js
CHANGED
|
@@ -271,7 +271,7 @@ export class PlayerService {
|
|
|
271
271
|
* more when the subscription starts, also without `read()`.
|
|
272
272
|
*/
|
|
273
273
|
/**
|
|
274
|
-
* A fact event's fields of the state
|
|
274
|
+
* A fact event's fields of the state: taken into the copy
|
|
275
275
|
* when `belongs` holds for it, as `accept` takes a state (a precise
|
|
276
276
|
* pass for the fields that changed); its event sequence is kept, so the
|
|
277
277
|
* next `source.state` is accepted as before.
|
|
@@ -636,7 +636,7 @@ function provideSequence(scope, provider) {
|
|
|
636
636
|
/**
|
|
637
637
|
* `audio.tracks.changed`'s data as the listener gets it (`ScopeImpl.fact`,
|
|
638
638
|
* SDK 1.11.0): the tracks as {@link PlayerState.audioTracks} lists them.
|
|
639
|
-
* The copy takes them first
|
|
639
|
+
* The copy takes them first, when they are of its source.
|
|
640
640
|
*/
|
|
641
641
|
export function audioTracksChanged(runtime, data) {
|
|
642
642
|
const { sourceId, audioTracks } = data;
|
|
@@ -646,7 +646,7 @@ export function audioTracksChanged(runtime, data) {
|
|
|
646
646
|
return { sourceId, audioTracks: audioTracks.map(audioTrack) };
|
|
647
647
|
}
|
|
648
648
|
/**
|
|
649
|
-
* `audio.devices.changed`'s data as the listener gets it
|
|
649
|
+
* `audio.devices.changed`'s data as the listener gets it:
|
|
650
650
|
* as the player sent it; the copy takes `requested` and `active` into
|
|
651
651
|
* {@link PlayerState.audioOutput} first.
|
|
652
652
|
*/
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vestra Player SDK
|
|
2
2
|
|
|
3
|
-
> @vestra-player/sdk 1.11.0-rc.
|
|
3
|
+
> @vestra-player/sdk 1.11.0-rc.5: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
|
|
4
4
|
|
|
5
5
|
## Read the documentation
|
|
6
6
|
|