@vestra-player/sdk 1.7.0 → 1.7.2
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 +16 -0
- package/README.md +6 -9
- package/bin/vestra-plugin.mjs +4 -4
- package/dist/api-requests.d.ts +8 -8
- package/dist/api-requests.js +8 -8
- package/dist/capability-check.d.ts +15 -15
- package/dist/capability-check.js +4 -4
- package/dist/capability-rules.d.ts +4 -5
- package/dist/capability-rules.js +4 -5
- package/dist/commands.d.ts +34 -44
- package/dist/commands.js +32 -38
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +13 -3
- package/dist/i18n-tools.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/media.d.ts +7 -7
- package/dist/palettes.d.ts +5 -5
- package/dist/palettes.js +5 -5
- package/dist/plugin/appearance.js +1 -1
- package/dist/plugin/bindings.d.ts +2 -3
- package/dist/plugin/bindings.js +2 -3
- package/dist/plugin/commands.js +10 -11
- package/dist/plugin/connection.d.ts +18 -19
- package/dist/plugin/connection.js +23 -24
- package/dist/plugin/index.d.ts +5 -5
- package/dist/plugin/index.js +1 -1
- package/dist/plugin/osd.d.ts +1 -1
- package/dist/plugin/osd.js +1 -1
- package/dist/plugin/passes.d.ts +4 -4
- package/dist/plugin/passes.js +4 -4
- package/dist/plugin/patch.d.ts +8 -8
- package/dist/plugin/patch.js +12 -12
- package/dist/plugin/player/events.js +5 -5
- package/dist/plugin/resolvers.js +3 -3
- package/dist/plugin/scope.d.ts +4 -4
- package/dist/plugin/scope.js +4 -4
- package/dist/plugin/services.d.ts +2 -3
- package/dist/plugin/services.js +2 -3
- package/dist/plugin/shaders.js +5 -6
- package/dist/plugin/state.js +10 -10
- package/dist/plugin/testing/commands.d.ts +4 -5
- package/dist/plugin/testing/commands.js +4 -5
- package/dist/plugin/testing/i18n.d.ts +1 -1
- package/dist/plugin/testing/i18n.js +1 -1
- package/dist/plugin/testing/index.d.ts +147 -165
- package/dist/plugin/testing/index.js +137 -155
- package/dist/plugin/testing/internals.d.ts +2 -2
- package/dist/plugin/testing/internals.js +2 -2
- package/dist/plugin/timeline.d.ts +1 -1
- package/dist/plugin/timeline.js +2 -2
- package/dist/plugin/types/base.d.ts +90 -111
- package/dist/plugin/types/commands.d.ts +142 -174
- package/dist/plugin/types/packages.d.ts +48 -63
- package/dist/plugin/types/playback.d.ts +45 -59
- package/dist/plugin/types/plugin-wire.d.ts +38 -45
- package/dist/plugin/types/processing.d.ts +52 -65
- package/dist/plugin/types/services.d.ts +18 -25
- package/dist/plugin/types/snapshots.d.ts +34 -46
- package/dist/plugin/types/sources.d.ts +14 -16
- package/dist/plugin/types/subtitles.d.ts +7 -8
- package/dist/plugin/types/ui-content.d.ts +111 -116
- package/dist/plugin/types/ui-layout.d.ts +52 -63
- package/dist/plugin/types/ui-locale.d.ts +41 -45
- package/dist/plugin/types/ui-shell.d.ts +69 -87
- package/dist/plugin/values.d.ts +15 -18
- package/dist/plugin/values.js +16 -19
- package/dist/plugin/view/base.d.ts +2 -2
- package/dist/plugin/view/base.js +7 -8
- package/dist/plugin/view/layout.d.ts +2 -2
- package/dist/plugin/view/panel.js +2 -4
- package/dist/plugin/view/writer.d.ts +8 -8
- package/dist/plugin/view/writer.js +37 -39
- package/dist/plugin/when.d.ts +3 -3
- package/dist/plugin/wire-facade.js +6 -7
- package/dist/processing.d.ts +26 -30
- package/dist/processing.js +4 -4
- package/dist/source-resolvers.d.ts +2 -2
- package/dist/source.d.ts +1 -2
- package/dist/subtitles.d.ts +1 -1
- package/dist/ts-plugin.d.ts +5 -5
- package/dist/wire.d.ts +63 -70
- package/dist/wire.js +21 -25
- package/llms.txt +7 -10
- package/package.json +1 -1
- package/slint/vestra/bar-buttons.slint +6 -8
- package/slint/vestra/focus.slint +1 -1
- package/slint/vestra/widgets.slint +2 -4
|
@@ -2,8 +2,7 @@ import type { Plugin } from "./base.ts";
|
|
|
2
2
|
import type { Disposable } from "./base.ts";
|
|
3
3
|
/**
|
|
4
4
|
* The manifest of a package, as validated. The display fields and
|
|
5
|
-
* `minPlayerVersion` are optional
|
|
6
|
-
* their rules.
|
|
5
|
+
* `minPlayerVersion` are optional; see the API reference for their rules.
|
|
7
6
|
*
|
|
8
7
|
* @since 1.0.0
|
|
9
8
|
* @category Packages
|
|
@@ -91,24 +90,18 @@ export interface InstallOptions {
|
|
|
91
90
|
*/
|
|
92
91
|
replace?: boolean;
|
|
93
92
|
/**
|
|
94
|
-
* Whether the plugin runs once installed
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* Player 0.6.4 and later: older players ignore it and an install there
|
|
107
|
-
* always runs the plugin, so after a committed install call
|
|
108
|
-
* {@link Packages.setEnabled} when the state matters.
|
|
109
|
-
*
|
|
110
|
-
* @player 0.6.4; older players ignore it (an install always
|
|
111
|
-
* enables the plugin).
|
|
93
|
+
* Whether the plugin runs once installed. Left out, a first install runs and
|
|
94
|
+
* an update or reinstall (from any source, `replace` included) keeps the
|
|
95
|
+
* installed plugin's state: one the user or a store disabled stays disabled,
|
|
96
|
+
* and only its files are installed (nothing starts it, so the change commits
|
|
97
|
+
* without an `activating` step). `true` enables and starts it, for example a
|
|
98
|
+
* version the store disabled that an update fixes; if it fails to start, the
|
|
99
|
+
* old version is restored, still disabled. `false` installs it disabled: a
|
|
100
|
+
* running version is stopped and its session values go, as with
|
|
101
|
+
* {@link Packages.setEnabled}. Built-in plugins always run (and cannot be
|
|
102
|
+
* installed over). A value that is not a boolean is `invalid`.
|
|
103
|
+
*
|
|
104
|
+
* @player 0.6.4
|
|
112
105
|
*/
|
|
113
106
|
enabled?: boolean;
|
|
114
107
|
}
|
|
@@ -150,14 +143,13 @@ export interface PackageCandidate {
|
|
|
150
143
|
/** The checks the player ran. */
|
|
151
144
|
readonly checks: string[];
|
|
152
145
|
/**
|
|
153
|
-
* Install it. The same source upgrades the installed plugin (its data
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* {@link InstallOptions.enabled}).
|
|
146
|
+
* Install it. The same source upgrades the installed plugin (its data stays);
|
|
147
|
+
* another source fails with `conflict` unless `replace` is set; a built-in id
|
|
148
|
+
* fails with `unsupported` (built-ins update with the player). A reserved id
|
|
149
|
+
* (`vestra` or `vestra.*`, which every built-in uses) fails with `reserved`
|
|
150
|
+
* (already when validated), as only the player installs built-in plugins. An
|
|
151
|
+
* update keeps a disabled plugin disabled unless `enabled` says otherwise
|
|
152
|
+
* (see {@link InstallOptions.enabled}).
|
|
161
153
|
*
|
|
162
154
|
* @capability plugins.manage
|
|
163
155
|
* @throws `invalid` (rejects) An option is malformed: a `source` the
|
|
@@ -189,10 +181,9 @@ export interface PackageCandidate {
|
|
|
189
181
|
* ```
|
|
190
182
|
*
|
|
191
183
|
* @example Enable a fixed version of a plugin the store disabled
|
|
192
|
-
* A store disabled a version it revoked; the update that fixes it
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* players ignore the option and enable every install.
|
|
184
|
+
* A store disabled a version it revoked; the update that fixes it should run
|
|
185
|
+
* again. Without `enabled` the update keeps the plugin disabled; `true`
|
|
186
|
+
* enables it once installed.
|
|
196
187
|
* ```ts
|
|
197
188
|
* declare const candidate: PackageCandidate;
|
|
198
189
|
* // ---cut---
|
|
@@ -326,9 +317,8 @@ export interface PluginInfo {
|
|
|
326
317
|
*/
|
|
327
318
|
directory: string;
|
|
328
319
|
/**
|
|
329
|
-
* Shipped with the player: it always runs; it cannot be disabled,
|
|
330
|
-
*
|
|
331
|
-
* `false` from players before 0.2.0.
|
|
320
|
+
* Shipped with the player: it always runs; it cannot be disabled, uninstalled
|
|
321
|
+
* or replaced.
|
|
332
322
|
*/
|
|
333
323
|
builtin: boolean;
|
|
334
324
|
/** Where an installed plugin came from; `null` for development loads. */
|
|
@@ -342,7 +332,7 @@ export interface PluginInfo {
|
|
|
342
332
|
* What a running plugin was refused because another plugin holds it: a
|
|
343
333
|
* panel position (`slot-occupied`, with `slot`) or the next/previous
|
|
344
334
|
* sequence (`sequence-taken`). Neither fails activation; `error` has the
|
|
345
|
-
* same as text.
|
|
335
|
+
* same as text.
|
|
346
336
|
* Always set by the SDK; optional so that code building `PluginInfo`
|
|
347
337
|
* values itself (tests) keeps compiling.
|
|
348
338
|
*
|
|
@@ -358,19 +348,17 @@ export interface PluginInfo {
|
|
|
358
348
|
*/
|
|
359
349
|
display?: PluginDisplay;
|
|
360
350
|
/**
|
|
361
|
-
* For `state: "running"`: `"running"` while its process runs, `"idle"`
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* {@link Packages.onChange}; a plugin stopped by the start limit (five
|
|
373
|
-
* crashes within 10 minutes) is `state: "failed"` with that in
|
|
351
|
+
* For `state: "running"`: `"running"` while its process runs, `"idle"` while
|
|
352
|
+
* the plugin is switched on but has no process. That is standby with
|
|
353
|
+
* on-demand start (lazy activation): nothing used it for the idle time, or
|
|
354
|
+
* the player's limit on third-party processes or low system memory stopped it
|
|
355
|
+
* early; it starts again on its next use, and its menu items, keys, settings
|
|
356
|
+
* pages, resolvers and drop targets stay. It is also the pause after a crash:
|
|
357
|
+
* a built-in or resident plugin waiting to start again by itself, or a plugin
|
|
358
|
+
* that has run before whose commands are shown disabled with the reason until
|
|
359
|
+
* the pause ends. Absent in other states. A change between the two alone does
|
|
360
|
+
* not fire {@link Packages.onChange}; a plugin stopped by the start limit
|
|
361
|
+
* (five crashes within 10 minutes) is `state: "failed"` with that in
|
|
374
362
|
* {@link PluginInfo.error}.
|
|
375
363
|
*
|
|
376
364
|
* @since 1.5.38
|
|
@@ -404,8 +392,8 @@ export interface PluginDisplay {
|
|
|
404
392
|
*/
|
|
405
393
|
export interface PluginWarning {
|
|
406
394
|
/**
|
|
407
|
-
* `"slot-occupied"`, `"sequence-taken"` or `"resolver-taken"
|
|
408
|
-
*
|
|
395
|
+
* `"slot-occupied"`, `"sequence-taken"` or `"resolver-taken"`; a newer player
|
|
396
|
+
* may add codes.
|
|
409
397
|
*/
|
|
410
398
|
code: string;
|
|
411
399
|
/** The panel position (`"bottom"`, `"backdrop"`; the sidebar and the adjust column hold any number of tabs) for `slot-occupied`. */
|
|
@@ -453,11 +441,10 @@ export interface Packages {
|
|
|
453
441
|
/**
|
|
454
442
|
* Validate a package directory (`plugins.manage`). A package whose id is
|
|
455
443
|
* reserved for the built-in plugins (`vestra` or `vestra.*`) fails with
|
|
456
|
-
* `reserved
|
|
444
|
+
* `reserved`.
|
|
457
445
|
*
|
|
458
|
-
* The player keeps the 32 most recent candidates of all plugins; an
|
|
459
|
-
*
|
|
460
|
-
* player 0.4.2 the 33rd validation of a run failed with `busy` instead.
|
|
446
|
+
* The player keeps the 32 most recent candidates of all plugins; an older
|
|
447
|
+
* one's `install` fails with `stale` (validate again).
|
|
461
448
|
*
|
|
462
449
|
* @capability plugins.manage
|
|
463
450
|
* @throws `host` (rejects) Not a package directory, or a manifest that
|
|
@@ -492,10 +479,10 @@ export interface Packages {
|
|
|
492
479
|
*/
|
|
493
480
|
validate(directory: string): Promise<PackageCandidate>;
|
|
494
481
|
/**
|
|
495
|
-
* Validate a `.vxp` package file (`plugins.manage
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
482
|
+
* Validate a `.vxp` package file (`plugins.manage`): the same checks as
|
|
483
|
+
* {@link Packages.validate} after unpacking. Check the file's sha256 yourself
|
|
484
|
+
* before calling when you know it. A reserved id fails with `reserved`, as in
|
|
485
|
+
* {@link Packages.validate}.
|
|
499
486
|
*
|
|
500
487
|
* @capability plugins.manage
|
|
501
488
|
* @throws `invalid` (rejects) The path does not end in `.vxp`, or the
|
|
@@ -567,8 +554,7 @@ export interface Packages {
|
|
|
567
554
|
* disabled across launches; a development load only for this run.
|
|
568
555
|
* `invalid` to disable oneself, `missing` unknown.
|
|
569
556
|
* `busy` while it is being installed or reloaded. `unsupported` to disable a built-in
|
|
570
|
-
* ({@link PluginInfo.builtin}): users manage third-party plugins only
|
|
571
|
-
* (players released with SDK 1.5.18 on; older ones disabled built-ins too).
|
|
557
|
+
* ({@link PluginInfo.builtin}): users manage third-party plugins only.
|
|
572
558
|
*
|
|
573
559
|
* @capability plugins.manage
|
|
574
560
|
* @throws `invalid` (rejects) Disabling the calling plugin itself.
|
|
@@ -604,8 +590,7 @@ export interface Packages {
|
|
|
604
590
|
* `invalid` for oneself or a disabled plugin (enable it instead),
|
|
605
591
|
* `missing` unknown, `busy` while it is being installed or reloaded.
|
|
606
592
|
*
|
|
607
|
-
* @player 0.5.1
|
|
608
|
-
* (`unsupported`).
|
|
593
|
+
* @player 0.5.1
|
|
609
594
|
* @since 1.5.19
|
|
610
595
|
*
|
|
611
596
|
* @capability plugins.manage
|
|
@@ -46,7 +46,7 @@ export interface TimelineMark {
|
|
|
46
46
|
*/
|
|
47
47
|
export type RangeStyle = "selection" | "region";
|
|
48
48
|
/**
|
|
49
|
-
* One range on the seek bar
|
|
49
|
+
* One range on the seek bar.
|
|
50
50
|
*
|
|
51
51
|
* @since 1.6.9
|
|
52
52
|
* @category Playback
|
|
@@ -89,10 +89,10 @@ export interface TimelineLayer extends Disposable {
|
|
|
89
89
|
/**
|
|
90
90
|
* Replace the layer (last write wins; `[]` clears it). At most 1000 marks,
|
|
91
91
|
* titles ≤ 100 characters, times within the media. Failures go to `onError`;
|
|
92
|
-
* with `ifCurrent`, a write for another source is dropped silently.
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
92
|
+
* with `ifCurrent`, a write for another source is dropped silently. A title
|
|
93
|
+
* is data (a chapter's or bookmark's own name), or a {@link Text} the player
|
|
94
|
+
* translates (`text("Chapter {}", [n])`); other plugins read the shown
|
|
95
|
+
* string.
|
|
96
96
|
*
|
|
97
97
|
* @example Show the file's bookmarks on the timeline
|
|
98
98
|
* Bookmark marks appear on the seek bar at their times, titled with the
|
|
@@ -122,10 +122,10 @@ export interface TimelineLayer extends Disposable {
|
|
|
122
122
|
}): void;
|
|
123
123
|
/**
|
|
124
124
|
* Replace the layer's ranges (last write wins; `[]` clears them), spans of
|
|
125
|
-
* the media drawn on the seek bar
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
125
|
+
* the media drawn on the seek bar. The marks and the ranges of a layer are
|
|
126
|
+
* replaced on their own: `set` keeps the ranges and `setRanges` keeps the
|
|
127
|
+
* marks. Disposing the layer, its scope or stopping the plugin removes both,
|
|
128
|
+
* and a new source clears every layer.
|
|
129
129
|
*
|
|
130
130
|
* At most 100 ranges (`TIMELINE_LIMITS.ranges`), `0 ≤ start < end`, `end`
|
|
131
131
|
* within the media while its duration is known, titles ≤ 100 characters.
|
|
@@ -133,10 +133,6 @@ export interface TimelineLayer extends Disposable {
|
|
|
133
133
|
* write for another source is dropped silently. A title is data or a
|
|
134
134
|
* {@link Text} the player translates, as in `set`.
|
|
135
135
|
*
|
|
136
|
-
* Players before 0.7.6 build `plugin` from an SDK without `setRanges`, so
|
|
137
|
-
* the call throws a `TypeError` there: declare
|
|
138
|
-
* `"minPlayerVersion": "0.7.6"`.
|
|
139
|
-
*
|
|
140
136
|
* @example Show the clip range on the seek bar while a panel is open
|
|
141
137
|
* The span the user picked shows on the seek bar in the accent colour
|
|
142
138
|
* while the plugin's tab is showing, and goes when it is not. Two point
|
|
@@ -199,11 +195,10 @@ export interface Timeline {
|
|
|
199
195
|
/** Every layer merged, by time (`playback.read`). Empty on a new source. */
|
|
200
196
|
readonly marks: readonly TimelineMark[];
|
|
201
197
|
/**
|
|
202
|
-
* Every layer's ranges merged, by start (`playback.read
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* only when the marks change.
|
|
198
|
+
* Every layer's ranges merged, by start (`playback.read`). Empty on a new
|
|
199
|
+
* source. Kept current like `marks` (with `events`): read it in a
|
|
200
|
+
* {@link View.bind} function and the view follows it. `onChange` runs only
|
|
201
|
+
* when the marks change.
|
|
207
202
|
*
|
|
208
203
|
* @example Draw the published ranges in a seek bar of your own
|
|
209
204
|
* A bottom bar draws a band for every range on the seek bar, whoever
|
|
@@ -298,7 +293,7 @@ export interface AudioTrack {
|
|
|
298
293
|
* Without `events`, {@link Player.state} only updates at start and after
|
|
299
294
|
* this plugin's own operations.
|
|
300
295
|
*
|
|
301
|
-
* @see {@link Player.state}, [
|
|
296
|
+
* @see {@link Player.state}, [Control playback](../../../docs/guides/control-playback.md)
|
|
302
297
|
* @since 1.0.0
|
|
303
298
|
* @category Playback
|
|
304
299
|
*/
|
|
@@ -431,7 +426,7 @@ export interface Chapter {
|
|
|
431
426
|
* });
|
|
432
427
|
* ```
|
|
433
428
|
*
|
|
434
|
-
* @see [
|
|
429
|
+
* @see [Control playback](../../../docs/guides/control-playback.md)
|
|
435
430
|
* @since 1.0.0
|
|
436
431
|
* @category Playback
|
|
437
432
|
*/
|
|
@@ -574,7 +569,7 @@ export interface Media {
|
|
|
574
569
|
* seeks resolve `false`.
|
|
575
570
|
*
|
|
576
571
|
* @capability playback.control
|
|
577
|
-
* @see [Keep a slider responsive while dragging](../../../docs/
|
|
572
|
+
* @see [Keep a slider responsive while dragging](../../../docs/guides/slider.md)
|
|
578
573
|
* @since 1.0.0
|
|
579
574
|
* @category Playback
|
|
580
575
|
*/
|
|
@@ -584,18 +579,16 @@ export interface Scrub {
|
|
|
584
579
|
* `false` when a newer target superseded it or the gesture ended. Rejects
|
|
585
580
|
* on a host failure.
|
|
586
581
|
*
|
|
587
|
-
* `keyframes: true
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* as before. Older players ignore the option and seek exactly: set
|
|
598
|
-
* `"minPlayerVersion": "0.5.3"` when you rely on it.
|
|
582
|
+
* `keyframes: true`: land on the last keyframe at or before `seconds` instead
|
|
583
|
+
* of decoding up to that exact frame. The picture appears at once on any file
|
|
584
|
+
* (tens of milliseconds instead of seconds on 4K video with keyframes far
|
|
585
|
+
* apart), up to one keyframe interval before the target; the position the
|
|
586
|
+
* player reports is the keyframe's. Use it when the user chose keyframe seeks
|
|
587
|
+
* (the same switch as {@link Player.setStepSeek}), and the exact seek
|
|
588
|
+
* otherwise. The player sends a repeated target of the same gesture only once
|
|
589
|
+
* while the seek is still running (a click is a press and a release), but an
|
|
590
|
+
* exact seek to the target of a keyframe seek is always sent. Omitted or
|
|
591
|
+
* `false`: exact, as before.
|
|
599
592
|
*
|
|
600
593
|
* @example Scrub on keyframes for a fast picture
|
|
601
594
|
* While dragging, the picture jumps to the nearest earlier keyframe at
|
|
@@ -843,8 +836,7 @@ export interface PlaybackStats {
|
|
|
843
836
|
* a new picture on screen. Lower than `video.fps` when frames are lost
|
|
844
837
|
* after decoding and rendering (the window could not keep up with the
|
|
845
838
|
* source, or the display refreshes slower); `0` while paused. `null` when
|
|
846
|
-
* the player cannot measure it (no window, the first second
|
|
847
|
-
* before 0.5.1).
|
|
839
|
+
* the player cannot measure it (no window, the first second).
|
|
848
840
|
*
|
|
849
841
|
* @player 0.5.1
|
|
850
842
|
* @since 1.5.15
|
|
@@ -950,7 +942,7 @@ export interface PlaybackStats {
|
|
|
950
942
|
* `events` to follow changes made elsewhere; `producer.av` for
|
|
951
943
|
* {@link Player.openStream}.
|
|
952
944
|
*
|
|
953
|
-
* @see [
|
|
945
|
+
* @see [Control playback](../../../docs/guides/control-playback.md)
|
|
954
946
|
* @since 1.0.0
|
|
955
947
|
* @category Playback
|
|
956
948
|
*/
|
|
@@ -1010,13 +1002,11 @@ export interface Player {
|
|
|
1010
1002
|
* {@link Scope.state} field re-runs only its readers, and
|
|
1011
1003
|
* {@link Scope.update} re-runs everything.
|
|
1012
1004
|
*
|
|
1013
|
-
* Each event needs a capability: `events` for most, `bindings.manage`
|
|
1014
|
-
*
|
|
1015
|
-
* `video.upscaling
|
|
1016
|
-
*
|
|
1017
|
-
*
|
|
1018
|
-
* yet (`commands.keys`, `video.upscaling.changed`) is refused with
|
|
1019
|
-
* `unsupported`; added during `activate`, that fails the activation.
|
|
1005
|
+
* Each event needs a capability: `events` for most, `bindings.manage` for
|
|
1006
|
+
* `bindings.changed`, `commands` for `commands.keys`, `video.upscaling` for
|
|
1007
|
+
* `video.upscaling.changed`, none for `packages.changed`. Without it the
|
|
1008
|
+
* listener never runs (for `events`, a warning in the log says so). Added
|
|
1009
|
+
* during `activate`, that fails the activation.
|
|
1020
1010
|
*
|
|
1021
1011
|
* @param event - The event's name.
|
|
1022
1012
|
* @param listener - Receives each event's data.
|
|
@@ -1037,7 +1027,7 @@ export interface Player {
|
|
|
1037
1027
|
* plugin.player.on("source.state", (s) => bar.set({ rate: `${s.rate.toFixed(2)}×` }));
|
|
1038
1028
|
* ```
|
|
1039
1029
|
*
|
|
1040
|
-
* @see [
|
|
1030
|
+
* @see [Tutorial](../../../docs/tutorial/index.md)
|
|
1041
1031
|
* @since 1.7.0
|
|
1042
1032
|
*/
|
|
1043
1033
|
on<E extends HostEvent>(event: E, listener: (data: EventPayload<E>) => void): Disposable;
|
|
@@ -1331,7 +1321,7 @@ export interface Player {
|
|
|
1331
1321
|
* bar.on("dragEnd", () => scrub?.end());
|
|
1332
1322
|
* ```
|
|
1333
1323
|
*
|
|
1334
|
-
* @see [Keep a slider responsive while dragging](../../../docs/
|
|
1324
|
+
* @see [Keep a slider responsive while dragging](../../../docs/guides/slider.md)
|
|
1335
1325
|
* @since 1.0.0
|
|
1336
1326
|
*/
|
|
1337
1327
|
scrub(): Scrub;
|
|
@@ -1566,21 +1556,17 @@ export interface Player {
|
|
|
1566
1556
|
* ← / →): 0.1–3600 seconds in tenths, default 5. The newest call of any
|
|
1567
1557
|
* plugin wins; it reverts when that plugin stops.
|
|
1568
1558
|
*
|
|
1569
|
-
* `keyframes: true
|
|
1570
|
-
*
|
|
1571
|
-
*
|
|
1572
|
-
*
|
|
1573
|
-
* step,
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1576
|
-
* video seek exactly. {@link Player.seek}, chapters, loops and
|
|
1559
|
+
* `keyframes: true`: the step seeks (`seek-backward` / `seek-forward`,
|
|
1560
|
+
* including {@link Host.run} with `seconds` and the picture-in-picture skips)
|
|
1561
|
+
* land on a keyframe instead of the exact time: forward on the first keyframe
|
|
1562
|
+
* at or after position + step, backward on the last at or before position −
|
|
1563
|
+
* step, and they always move. Presses during a seek add up and continue from
|
|
1564
|
+
* where it landed; the on-screen text shows the landed time. Sources without
|
|
1565
|
+
* moving video seek exactly. {@link Player.seek}, chapters, loops and
|
|
1577
1566
|
* {@link Player.step} are unaffected, and so is a scrub unless it asks for
|
|
1578
|
-
* keyframes itself ({@link Scrub.seek} with `keyframes: true
|
|
1579
|
-
*
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1582
|
-
* Older players ignore `keyframes`: set `"minPlayerVersion": "0.5.1"` in
|
|
1583
|
-
* the manifest when you rely on it.
|
|
1567
|
+
* keyframes itself ({@link Scrub.seek} with `keyframes: true`). Omitted or
|
|
1568
|
+
* `false`: exact seeks, as before. `seconds` and `keyframes` are written as a
|
|
1569
|
+
* pair: the newest call sets both.
|
|
1584
1570
|
*
|
|
1585
1571
|
* @capability playback.control
|
|
1586
1572
|
* @throws `invalid` (rejects) `seconds` outside 0.1–3600 or not in tenths,
|
|
@@ -34,10 +34,9 @@ import type { View } from "./ui-content.ts";
|
|
|
34
34
|
* name and says which one; a method name it cannot read is reported as
|
|
35
35
|
* unchecked).
|
|
36
36
|
*
|
|
37
|
-
* [
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* event names are in [Messages](../../../docs/reference/messages.md) and
|
|
37
|
+
* The [Tutorial](../../../docs/tutorial/index.md) shows `bind()` (the
|
|
38
|
+
* default), {@link Player.on} with {@link View.set}, and `plugin.wire`
|
|
39
|
+
* side by side, from examples/three-ways; the method and event names are in [Messages](../../../docs/reference/messages.md) and
|
|
41
40
|
* [Events](../../../docs/reference/events.md).
|
|
42
41
|
*
|
|
43
42
|
* @example Show the speed with direct messages
|
|
@@ -65,14 +64,12 @@ export interface Wire {
|
|
|
65
64
|
* Send one request to the player by its method name and get its answer.
|
|
66
65
|
*
|
|
67
66
|
* @remarks
|
|
68
|
-
* Experimental: the wire protocol is not semver; this member changes
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* player does not know is refused with `unsupported` or `invalid`: compare
|
|
75
|
-
* `plugin.app.version` with the player that added it.
|
|
67
|
+
* Experimental: the wire protocol is not semver; this member changes with
|
|
68
|
+
* versions. `method` and `params` go to the player as given; the answer is
|
|
69
|
+
* the player's result, typed by the caller (`T`). The player checks the
|
|
70
|
+
* capability the method needs and refuses with `capability` when the manifest
|
|
71
|
+
* does not declare it; its other refusals arrive with their own codes
|
|
72
|
+
* (`invalid`, `missing`, `stale`…).
|
|
76
73
|
*
|
|
77
74
|
* Nothing of the SDK's sits between: no value limits, no `seq` or
|
|
78
75
|
* revision, no retry after a lost reply, no wait during activation. A
|
|
@@ -220,16 +217,15 @@ export interface Wire {
|
|
|
220
217
|
* correct for the properties it compares.
|
|
221
218
|
*
|
|
222
219
|
* What the SDK does for these writes: one write in flight per property, in
|
|
223
|
-
* order (a whole value drops the writes still waiting before it, which
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* names are written in camelCase or as in Slint, as for {@link View.set}.
|
|
220
|
+
* order (a whole value drops the writes still waiting before it, which resolve
|
|
221
|
+
* `false`); with a player that takes row patches a whole value without `seq`
|
|
222
|
+
* gets one, a list larger than one request (512 KB of rows) goes in parts, and
|
|
223
|
+
* row operations are numbered and split the same way. What it leaves to the
|
|
224
|
+
* plugin: the value limits (the player refuses a value over them with `limit`),
|
|
225
|
+
* Markdown documents and images in wire form, and a `stale` refusal of row
|
|
226
|
+
* operations (the player shows something else than they apply on: write the
|
|
227
|
+
* whole value). Property names are written in camelCase or as in Slint, as for
|
|
228
|
+
* {@link View.set}.
|
|
233
229
|
*
|
|
234
230
|
* While the view does not show (a window before `show()`, a panel or
|
|
235
231
|
* settings page before `ready`, a closed one) a write is refused with
|
|
@@ -264,14 +260,13 @@ export interface WireView {
|
|
|
264
260
|
* Write one property: a whole value, or a row patch of the plugin's own.
|
|
265
261
|
*
|
|
266
262
|
* @remarks
|
|
267
|
-
* Experimental: the wire protocol is not semver; this member changes
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* for you.
|
|
263
|
+
* Experimental: the wire protocol is not semver; this member changes with
|
|
264
|
+
* versions. `{ value }` replaces the property; a player that takes row
|
|
265
|
+
* patches gets it with a `seq` (the SDK numbers it unless given) and a list
|
|
266
|
+
* over one request's size in parts with `more`.
|
|
267
|
+
* `{ patch: { base, seq, ops } }` is sent as given: `base` is the `seq` of
|
|
268
|
+
* the write it applies on. {@link WireView.writeRows} numbers patches for
|
|
269
|
+
* you.
|
|
275
270
|
*
|
|
276
271
|
* @param property - The Slint property's name.
|
|
277
272
|
* @param write - The write, as the player takes it.
|
|
@@ -309,17 +304,16 @@ export interface WireView {
|
|
|
309
304
|
* Change a list property by row operations, numbered by the SDK.
|
|
310
305
|
*
|
|
311
306
|
* @remarks
|
|
312
|
-
* Experimental: the wire protocol is not semver; this member changes
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
* (player 0.6.0).
|
|
307
|
+
* Experimental: the wire protocol is not semver; this member changes with
|
|
308
|
+
* versions. The operations apply, in order, on what the player shows for the
|
|
309
|
+
* property after this view's last direct write of it since the view showed
|
|
310
|
+
* its initial properties: `set` one row, `insert` rows, `remove` or `move` a
|
|
311
|
+
* run of rows, by index. Without such a write (the property was never written
|
|
312
|
+
* directly, or the window was shown again since) the player has no rows of
|
|
313
|
+
* the plugin's for it: write the whole value with {@link WireView.write}
|
|
314
|
+
* first. They go as one patch, or several applying on each other when they
|
|
315
|
+
* exceed one request (1024 operations or 512 KB of rows). Needs a player that
|
|
316
|
+
* takes row patches.
|
|
323
317
|
*
|
|
324
318
|
* @param property - The Slint property's name.
|
|
325
319
|
* @param ops - The operations, applied in order.
|
|
@@ -403,9 +397,8 @@ export interface WireCommands {
|
|
|
403
397
|
* @remarks
|
|
404
398
|
* Experimental: the wire protocol is not semver; this member changes
|
|
405
399
|
* with versions. `declaration` is `commands.register`'s: `title`, `path`,
|
|
406
|
-
* `order`, `group`, `radio`, `bindings`, `focus`, `repeat`,
|
|
407
|
-
*
|
|
408
|
-
* {@link CommandOptions} for the player each needs). The SDK adds the id,
|
|
400
|
+
* `order`, `group`, `radio`, `bindings`, `focus`, `repeat`, `button`,
|
|
401
|
+
* `category` and `home` (as in {@link CommandOptions}). The SDK adds the id,
|
|
409
402
|
* the revision and the state and checks nothing in it: bindings must
|
|
410
403
|
* already be in the player's canonical form (`Ctrl+H`).
|
|
411
404
|
*
|
|
@@ -471,7 +464,7 @@ export interface WireCommandOptions {
|
|
|
471
464
|
* busy, no reason.
|
|
472
465
|
*/
|
|
473
466
|
readonly state?: WireCommandState;
|
|
474
|
-
/** The player's conditions for `enabled` and `checked`, in wire form
|
|
467
|
+
/** The player's conditions for `enabled` and `checked`, in wire form. */
|
|
475
468
|
readonly when?: Json;
|
|
476
469
|
/** Runs when the user picks the command or presses its key. */
|
|
477
470
|
readonly run?: () => unknown;
|