@vestra-player/sdk 1.8.0 → 1.9.0
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 +40 -0
- package/README.md +2 -2
- package/bin/vestra-plugin.mjs +11 -100
- package/capability-scan.json +3 -1
- package/dist/api-requests.d.ts +11 -36
- package/dist/api-requests.js +18 -47
- package/dist/capability-scan.d.ts +1 -1
- package/dist/capability-scan.js +8 -9
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/manifest.d.ts +5 -0
- package/dist/manifest.js +9 -24
- package/dist/member-uses.d.ts +61 -0
- package/dist/member-uses.js +160 -0
- package/dist/player-runtime.d.ts +1 -2
- package/dist/player-runtime.js +1 -2
- package/dist/plugin/appearance.d.ts +1 -1
- package/dist/plugin/appearance.js +2 -2
- package/dist/plugin/bindings.d.ts +1 -1
- package/dist/plugin/bindings.js +2 -2
- package/dist/plugin/commands.js +1 -12
- package/dist/plugin/connection.d.ts +26 -7
- package/dist/plugin/connection.js +68 -36
- package/dist/plugin/drops.js +1 -1
- package/dist/plugin/index.js +9 -15
- package/dist/plugin/media.js +0 -12
- package/dist/plugin/mpv.js +0 -7
- package/dist/plugin/packages.js +1 -2
- package/dist/plugin/player/events.d.ts +4 -3
- package/dist/plugin/player/events.js +7 -6
- package/dist/plugin/player.d.ts +21 -13
- package/dist/plugin/player.js +56 -21
- package/dist/plugin/services.d.ts +4 -4
- package/dist/plugin/services.js +7 -29
- package/dist/plugin/settings.js +1 -1
- package/dist/plugin/shaders.js +0 -2
- package/dist/plugin/stream.d.ts +2 -1
- package/dist/plugin/stream.js +2 -2
- package/dist/plugin/testing/commands.d.ts +3 -10
- package/dist/plugin/testing/commands.js +6 -15
- package/dist/plugin/testing/index.d.ts +26 -116
- package/dist/plugin/testing/index.js +30 -104
- package/dist/plugin/testing/processing.js +1 -1
- package/dist/plugin/testing/services.js +0 -1
- package/dist/plugin/timeline.d.ts +2 -3
- package/dist/plugin/timeline.js +4 -8
- package/dist/plugin/types/base.d.ts +40 -86
- package/dist/plugin/types/commands.d.ts +10 -67
- package/dist/plugin/types/packages.d.ts +17 -55
- package/dist/plugin/types/playback.d.ts +126 -144
- package/dist/plugin/types/plugin-wire.d.ts +6 -36
- package/dist/plugin/types/processing.d.ts +10 -49
- package/dist/plugin/types/services.d.ts +11 -70
- package/dist/plugin/types/snapshots.d.ts +7 -60
- package/dist/plugin/types/sources.d.ts +2 -11
- package/dist/plugin/types/subtitles.d.ts +5 -26
- package/dist/plugin/types/ui-content.d.ts +1 -16
- package/dist/plugin/types/ui-layout.d.ts +53 -79
- package/dist/plugin/types/ui-locale.d.ts +5 -23
- package/dist/plugin/types/ui-shell.d.ts +13 -59
- package/dist/plugin/view/layout.js +1 -1
- package/dist/plugin/view.js +0 -2
- package/dist/plugin/window.d.ts +1 -1
- package/dist/plugin/window.js +1 -1
- package/dist/plugin/wire-facade.js +1 -2
- package/dist/processing.d.ts +2 -3
- package/dist/protocol.d.ts +14 -0
- package/dist/protocol.js +14 -0
- package/dist/request-queue.js +1 -1
- package/dist/subtitles.d.ts +1 -1
- package/dist/ts-plugin.d.ts +8 -15
- package/dist/ts-plugin.js +3 -141
- package/dist/wire.d.ts +7 -12
- package/dist/wire.js +6 -8
- package/llms.txt +4 -4
- package/package.json +1 -2
- package/dist/capabilities.d.ts +0 -107
- package/dist/capabilities.js +0 -69
- package/dist/capability-check.d.ts +0 -176
- package/dist/capability-check.js +0 -461
- package/dist/capability-rules.d.ts +0 -125
- package/dist/capability-rules.js +0 -192
- package/dist/host-capabilities.d.ts +0 -10
- package/dist/host-capabilities.js +0 -492
|
@@ -58,7 +58,6 @@ import type { Wire } from "./plugin-wire.ts";
|
|
|
58
58
|
* created it; disposing the scope (or stopping the plugin) disposes them in
|
|
59
59
|
* reverse creation order, so a plugin rarely calls `dispose` itself.
|
|
60
60
|
*
|
|
61
|
-
* @capability None of its own: that of the handle.
|
|
62
61
|
* @since 1.0.0
|
|
63
62
|
* @category Plugin
|
|
64
63
|
*/
|
|
@@ -67,7 +66,6 @@ export interface Disposable {
|
|
|
67
66
|
* Release the resource. Resolves once the player confirmed the release
|
|
68
67
|
* (or immediately for purely local resources). Never rejects.
|
|
69
68
|
*
|
|
70
|
-
* @capability None of its own: that of the handle.
|
|
71
69
|
* @throws Never.
|
|
72
70
|
*
|
|
73
71
|
* @example Remove a command when its feature is turned off
|
|
@@ -96,7 +94,7 @@ export interface Disposable {
|
|
|
96
94
|
* | code | meaning |
|
|
97
95
|
* | --- | --- |
|
|
98
96
|
* | `stale` | A condition no longer held (the source or the subtitle selection changed); nothing was done. See {@link Conditional}. |
|
|
99
|
-
* | `capability` | The
|
|
97
|
+
* | `capability` | The call is for the player's built-in plugins only (`commands.list`, `commands.run`, `palette.lead`) and this plugin is not one. |
|
|
100
98
|
* | `invalid` | A bad argument (out of range, malformed, unknown id). |
|
|
101
99
|
* | `missing` | The target does not exist (an empty panel position, a missing file, an unknown command). |
|
|
102
100
|
* | `busy` | The player is still doing a previous call of the same kind (a dialog is open, a step is in flight). |
|
|
@@ -117,7 +115,7 @@ export interface Disposable {
|
|
|
117
115
|
* | `limit` | A player-wide limit was reached (for example the number of commands), a property value is over the limits of {@link PropValue}, a request is longer than the player's 1 MiB message, {@link Commands.run} ran too often, or a client that bypasses the SDK left more than 320 requests or 4 MiB of them unanswered (the player's backstop; the SDK keeps a plugin under it). |
|
|
118
116
|
* | `reserved` | {@link Packages.validate}, {@link PackageCandidate.install}: the id is `vestra` or starts with `vestra.` (any case), which only the player's built-in plugins use. |
|
|
119
117
|
* | `versionMismatch` | The package needs a newer player (`minPlayerVersion`). |
|
|
120
|
-
* | `ui-prepare` | The player could not prepare a mounted panel or a settings page (its Slint file does not compile, a bound property is not declared
|
|
118
|
+
* | `ui-prepare` | The player could not prepare a mounted panel or a settings page (its Slint file does not compile, or a bound property is not declared); `message` has the diagnostics. A panel shown at once rejects its `ready`; a tab mounted in the background is compiled when it is first shown, and its failure goes to {@link Scope.onError} without a request (see {@link Panel.ready}). |
|
|
121
119
|
* | `ui` | The player could not apply a property to a tool window or a settings page, or could not build the Options window (a property the Slint file does not declare, a value of the wrong type); `message` has Slint's reason. Also reported to {@link Scope.onError} without a request: a callback whose arguments the player could not convert, a property it could not show again when it rebuilt a view (an image file removed since). |
|
|
122
120
|
* | `host` | Any other failure inside the player; `message` is the player's reason. |
|
|
123
121
|
* | `disabled` | The plugin is being stopped; pending requests fail with it. {@link Commands.run}: the command is disabled; `message` has its reason. |
|
|
@@ -175,7 +173,6 @@ export type PluginError = Error & {
|
|
|
175
173
|
* `child.dispose()` releases its handles and deeper children in reverse
|
|
176
174
|
* creation order.
|
|
177
175
|
*
|
|
178
|
-
* Capabilities: each module documents the manifest capability it needs.
|
|
179
176
|
* Reading {@link Scope.window}, {@link Scope.app}, {@link Scope.appearance}
|
|
180
177
|
* `.theme`, {@link Scope.ui}, {@link Scope.tools}, {@link Scope.storage} and
|
|
181
178
|
* {@link Scope.system} needs none.
|
|
@@ -210,7 +207,6 @@ export type PluginError = Error & {
|
|
|
210
207
|
* go: dispose the child and everything it created is released, while the
|
|
211
208
|
* rest of the plugin keeps running.
|
|
212
209
|
*
|
|
213
|
-
* @capability That of each module (see the modules).
|
|
214
210
|
* @since 1.0.0
|
|
215
211
|
* @category Plugin
|
|
216
212
|
*/
|
|
@@ -223,22 +219,20 @@ export interface Scope extends Disposable {
|
|
|
223
219
|
* while the plugin is stopped. See {@link When}.
|
|
224
220
|
*/
|
|
225
221
|
readonly when: When;
|
|
226
|
-
/** Tool windows from `.slint` files
|
|
222
|
+
/** Tool windows from `.slint` files. */
|
|
227
223
|
readonly windows: Windows;
|
|
228
|
-
/** Docked panels: bottom bar, sidebar and backdrop
|
|
224
|
+
/** Docked panels: bottom bar, sidebar and backdrop. */
|
|
229
225
|
readonly panels: Panels;
|
|
230
|
-
/** Native file dialogs and confirmation alerts
|
|
226
|
+
/** Native file dialogs and confirmation alerts. */
|
|
231
227
|
readonly dialogs: Dialogs;
|
|
232
|
-
/** Playback state and controls
|
|
228
|
+
/** Playback state and controls. */
|
|
233
229
|
readonly player: Player;
|
|
234
230
|
/**
|
|
235
231
|
* Video processing: this plugin's filter chain, the display layer, the
|
|
236
232
|
* GPU render options, this plugin's shaders, the GPU's video upscaler and
|
|
237
|
-
* motion smoothing. The
|
|
238
|
-
* `
|
|
239
|
-
*
|
|
240
|
-
* The upscaler needs `video.upscaling` only, motion smoothing
|
|
241
|
-
* `video.motion` only.
|
|
233
|
+
* motion smoothing. The filter chain follows the player: call
|
|
234
|
+
* `plugin.player.subscribe()` and `plugin.player.read()` first (without `subscribe()` the SDK never sees
|
|
235
|
+
* the media become ready and the chain stays `waiting`).
|
|
242
236
|
*/
|
|
243
237
|
readonly video: {
|
|
244
238
|
/**
|
|
@@ -250,38 +244,31 @@ export interface Scope extends Disposable {
|
|
|
250
244
|
*/
|
|
251
245
|
filter(id: string): VideoFilter;
|
|
252
246
|
/**
|
|
253
|
-
* The display layer
|
|
247
|
+
* The display layer. The first plugin to call
|
|
254
248
|
* it owns the layer; another plugin's view fails with `conflict` until the
|
|
255
249
|
* owner disposes or stops.
|
|
256
250
|
*
|
|
257
|
-
* @throws `capability` (throws) The manifest does not declare
|
|
258
|
-
* `processing.video`.
|
|
259
251
|
* @throws `Error` without a code (throws) A second call in the same plugin
|
|
260
252
|
* while the first view is not disposed.
|
|
261
253
|
*/
|
|
262
254
|
view(): VideoView;
|
|
263
255
|
/**
|
|
264
|
-
* The GPU renderer's options
|
|
256
|
+
* The GPU renderer's options, owned like the
|
|
265
257
|
* display layer. Under software rendering the handle is `failed` with
|
|
266
258
|
* `unsupported` after the player's first answer, and `onError` hears it.
|
|
267
259
|
*
|
|
268
|
-
* @throws `capability` (throws) The manifest does not declare
|
|
269
|
-
* `processing.video`.
|
|
270
260
|
* @throws `Error` without a code (throws) A second call in the same plugin
|
|
271
261
|
* while the first handle is not disposed.
|
|
272
262
|
*/
|
|
273
263
|
render(): RenderOptions;
|
|
274
264
|
/**
|
|
275
|
-
* This plugin's own GPU shaders named `id` (default `"shaders"
|
|
276
|
-
* `processing.video`). Unlike {@link Scope.video | render()}, every plugin
|
|
265
|
+
* This plugin's own GPU shaders named `id` (default `"shaders"`). Unlike {@link Scope.video | render()}, every plugin
|
|
277
266
|
* may hold shader handles at the same time; the player joins their lists.
|
|
278
267
|
* Nothing is sent until the first `set()`.
|
|
279
268
|
*
|
|
280
269
|
* @param id - Local name of the handle, 1–128 bytes, unique within
|
|
281
270
|
* the plugin.
|
|
282
271
|
* @returns A {@link VideoShaders} owned by this scope.
|
|
283
|
-
* @throws `capability` (throws) The manifest does not declare
|
|
284
|
-
* `processing.video`.
|
|
285
272
|
* @throws `invalid` (throws) `id` is empty, longer than 128 bytes or
|
|
286
273
|
* has control characters.
|
|
287
274
|
* @throws `Error` without a code (throws) A second handle with the
|
|
@@ -289,14 +276,13 @@ export interface Scope extends Disposable {
|
|
|
289
276
|
*/
|
|
290
277
|
shaders(id?: string): VideoShaders;
|
|
291
278
|
/**
|
|
292
|
-
* The GPU's video upscaler (NVIDIA RTX Video Super Resolution on
|
|
293
|
-
*
|
|
279
|
+
* The GPU's video upscaler (NVIDIA RTX Video Super Resolution on
|
|
280
|
+
* Windows): whether it works here and why not, and turning
|
|
294
281
|
* it on or off for this plugin.
|
|
295
282
|
*/
|
|
296
283
|
readonly upscaling: VideoUpscaling;
|
|
297
284
|
/**
|
|
298
|
-
* Motion smoothing with one GPU vendor's frame-rate converter
|
|
299
|
-
* `video.motion`): whether it works here and why not, and this
|
|
285
|
+
* Motion smoothing with one GPU vendor's frame-rate converter: whether it works here and why not, and this
|
|
300
286
|
* plugin's mode. `amd` is AMD AMF's on Windows; `nvidia` is reserved
|
|
301
287
|
* (every mode reports `engine` until a player has it).
|
|
302
288
|
*
|
|
@@ -309,9 +295,8 @@ export interface Scope extends Disposable {
|
|
|
309
295
|
motion(engine: MotionEngine): VideoMotion;
|
|
310
296
|
};
|
|
311
297
|
/**
|
|
312
|
-
* Audio processing: this plugin's filter chain and delay
|
|
313
|
-
*
|
|
314
|
-
* {@link VideoFilter}).
|
|
298
|
+
* Audio processing: this plugin's filter chain and delay (it follows the
|
|
299
|
+
* player as {@link VideoFilter} does).
|
|
315
300
|
*/
|
|
316
301
|
readonly audio: {
|
|
317
302
|
/**
|
|
@@ -323,15 +308,15 @@ export interface Scope extends Disposable {
|
|
|
323
308
|
*/
|
|
324
309
|
filter(id: string): AudioFilter;
|
|
325
310
|
};
|
|
326
|
-
/** Subtitle tracks, uploads and style
|
|
311
|
+
/** Subtitle tracks, uploads and style. */
|
|
327
312
|
readonly subtitles: Subtitles;
|
|
328
|
-
/** Frozen snapshots and offline exports
|
|
313
|
+
/** Frozen snapshots and offline exports. */
|
|
329
314
|
readonly media: MediaCapture;
|
|
330
|
-
/** Page-URL to stream-URL resolvers
|
|
315
|
+
/** Page-URL to stream-URL resolvers. */
|
|
331
316
|
readonly resolvers: Resolvers;
|
|
332
|
-
/** The installed plugins; validation, installs
|
|
317
|
+
/** The installed plugins; validation, installs. */
|
|
333
318
|
readonly packages: Packages;
|
|
334
|
-
/** On-screen messages over the video
|
|
319
|
+
/** On-screen messages over the video. */
|
|
335
320
|
readonly osd: Osd;
|
|
336
321
|
/** The command palette's lead row (`palette.lead`, built-in plugins only). */
|
|
337
322
|
readonly palette: Palette;
|
|
@@ -339,7 +324,7 @@ export interface Scope extends Disposable {
|
|
|
339
324
|
readonly host: Host;
|
|
340
325
|
/** The system clipboard (`clipboard`). */
|
|
341
326
|
readonly clipboard: Clipboard;
|
|
342
|
-
/** Keeping the computer awake while playing
|
|
327
|
+
/** Keeping the computer awake while playing. */
|
|
343
328
|
readonly power: Power;
|
|
344
329
|
/** ffmpeg / ffprobe, run by this plugin's process. */
|
|
345
330
|
readonly tools: Tools;
|
|
@@ -359,21 +344,21 @@ export interface Scope extends Disposable {
|
|
|
359
344
|
readonly window: MainWindow;
|
|
360
345
|
/** The player's version and components, and the system it runs on. */
|
|
361
346
|
readonly app: App;
|
|
362
|
-
/** GPU or software rendering: read the choice, change it
|
|
347
|
+
/** GPU or software rendering: read the choice, change it. */
|
|
363
348
|
readonly rendering: Rendering;
|
|
364
|
-
/** Every command's bindings and the user's overrides
|
|
349
|
+
/** Every command's bindings and the user's overrides. */
|
|
365
350
|
readonly bindings: Bindings;
|
|
366
351
|
/** Runtime images for Slint `image` properties. */
|
|
367
352
|
readonly ui: Ui;
|
|
368
353
|
/** Marks on the seek bar, merged from every plugin's layer. */
|
|
369
354
|
readonly timeline: Timeline;
|
|
370
|
-
/** Files dropped on the video area, by extension
|
|
355
|
+
/** Files dropped on the video area, by extension. */
|
|
371
356
|
readonly drops: Drops;
|
|
372
357
|
/** The player's palette and the saved interface language. */
|
|
373
358
|
readonly appearance: Appearance;
|
|
374
359
|
/** The interface language of this run (read-only). */
|
|
375
360
|
readonly i18n: I18n;
|
|
376
|
-
/** Pages in the player's options window
|
|
361
|
+
/** Pages in the player's options window. */
|
|
377
362
|
readonly settings: Settings;
|
|
378
363
|
/**
|
|
379
364
|
* Direct messages to the player: requests by method name, raw events, direct
|
|
@@ -389,8 +374,6 @@ export interface Scope extends Disposable {
|
|
|
389
374
|
* A child scope; disposing it releases only what was created through it.
|
|
390
375
|
* The child is itself owned by this scope.
|
|
391
376
|
*
|
|
392
|
-
* @capability None.
|
|
393
|
-
*
|
|
394
377
|
* @example Tie a temporary window and its timer to one feature
|
|
395
378
|
* A "Live stats" feature opens a window and starts a timer; turning it off
|
|
396
379
|
* releases both together. Everything made through the child scope, and
|
|
@@ -427,8 +410,6 @@ export interface Scope extends Disposable {
|
|
|
427
410
|
* through another scope.
|
|
428
411
|
* @returns `item` itself, for chaining.
|
|
429
412
|
*
|
|
430
|
-
* @capability None.
|
|
431
|
-
*
|
|
432
413
|
* @example Dispose a handle from another scope together with this one
|
|
433
414
|
* A filter made through the root scope is withdrawn when a child feature
|
|
434
415
|
* ends. `add` hands an existing disposable to this scope, which then
|
|
@@ -482,7 +463,6 @@ export interface Scope extends Disposable {
|
|
|
482
463
|
* `DisposeInfo` as its first argument: wrap it (`() => controller.abort()`)
|
|
483
464
|
* when that matters.
|
|
484
465
|
*
|
|
485
|
-
* @capability None.
|
|
486
466
|
* @since 1.0.0
|
|
487
467
|
*/
|
|
488
468
|
onDispose(cleanup: ((info?: DisposeInfo) => void | Promise<void>) | (() => void | Promise<void>)): Disposable;
|
|
@@ -506,7 +486,6 @@ export interface Scope extends Disposable {
|
|
|
506
486
|
* });
|
|
507
487
|
* ```
|
|
508
488
|
*
|
|
509
|
-
* @capability None.
|
|
510
489
|
* @since 1.0.0
|
|
511
490
|
*/
|
|
512
491
|
onError(listener: (error: PluginError) => void): Disposable;
|
|
@@ -518,8 +497,6 @@ export interface Scope extends Disposable {
|
|
|
518
497
|
*
|
|
519
498
|
* Several calls within one microtask are merged into one pass.
|
|
520
499
|
*
|
|
521
|
-
* @capability None.
|
|
522
|
-
*
|
|
523
500
|
* @example Show progress from a long task between awaits
|
|
524
501
|
* A progress label moves while a long download runs, not only when it
|
|
525
502
|
* ends. The SDK re-evaluates bound values after each handler and when its
|
|
@@ -586,8 +563,6 @@ export interface Scope extends Disposable {
|
|
|
586
563
|
* @throws `invalid` (throws) `initial` is not a plain object (`null`, an
|
|
587
564
|
* array, a class instance).
|
|
588
565
|
*
|
|
589
|
-
* @capability None.
|
|
590
|
-
*
|
|
591
566
|
* @example Show a check's answer without a manual update
|
|
592
567
|
* A panel shows whether the current file has video once an asynchronous
|
|
593
568
|
* check answers. The answer is written to a tracked field; only the
|
|
@@ -638,7 +613,7 @@ export interface Scope extends Disposable {
|
|
|
638
613
|
* Tools ▸ Say hello, or Ctrl+H, shows "Hello from" and the plugin's id.
|
|
639
614
|
* The player imports `main.ts`, calls its default export with the
|
|
640
615
|
* `Plugin` object, and keeps the registrations made during activation;
|
|
641
|
-
* the manifest
|
|
616
|
+
* the manifest says only who the plugin is.
|
|
642
617
|
* ```ts
|
|
643
618
|
* import type { Plugin } from "@vestra-player/sdk";
|
|
644
619
|
*
|
|
@@ -657,7 +632,6 @@ export interface Scope extends Disposable {
|
|
|
657
632
|
* the modules of {@link Scope}, it carries the plugin's `id` and its
|
|
658
633
|
* `dataDirectory`.
|
|
659
634
|
*
|
|
660
|
-
* @capability That of each module (see the modules).
|
|
661
635
|
* @see [Tutorial](../../../docs/tutorial/index.md)
|
|
662
636
|
* @since 1.0.0
|
|
663
637
|
* @category Plugin
|
|
@@ -671,7 +645,7 @@ export interface Plugin extends Scope {
|
|
|
671
645
|
* Each installation has its own directory: it is kept across restarts,
|
|
672
646
|
* disabling and upgrades, and a reinstall of the same id from a different
|
|
673
647
|
* source gets a new, empty one. It is deleted only by
|
|
674
|
-
* `packages.uninstall(id, { removeData: true })`.
|
|
648
|
+
* `packages.uninstall(id, { removeData: true })`.
|
|
675
649
|
*
|
|
676
650
|
* The path's format is not part of the API: do not derive another
|
|
677
651
|
* plugin's directory from it (a plugin manager reads
|
|
@@ -694,7 +668,7 @@ export interface Plugin extends Scope {
|
|
|
694
668
|
* - `quit`: the player quits (or restarts after a lost GPU device). Every
|
|
695
669
|
* plugin is stopped at the same time, with 1 s in all (300 ms after a lost
|
|
696
670
|
* device).
|
|
697
|
-
* - `disable`: the user, or a plugin
|
|
671
|
+
* - `disable`: the user, or a plugin that manages plugins, switched the
|
|
698
672
|
* plugin off. Its session storage is cleared.
|
|
699
673
|
* - `uninstall`: the user uninstalls it.
|
|
700
674
|
* - `reload`: it is reloaded (from the plugin manager, or a development
|
|
@@ -807,9 +781,9 @@ export interface WindowState {
|
|
|
807
781
|
};
|
|
808
782
|
}
|
|
809
783
|
/**
|
|
810
|
-
* The player's main window
|
|
784
|
+
* The player's main window: read it, change it.
|
|
811
785
|
*
|
|
812
|
-
*
|
|
786
|
+
* After `plugin.player.subscribe()`, `state` follows the window from the first read or
|
|
813
787
|
* `onChange`; without it, it updates only at start and after this plugin's
|
|
814
788
|
* `setVideoArea`.
|
|
815
789
|
*
|
|
@@ -836,12 +810,9 @@ export interface WindowState {
|
|
|
836
810
|
*
|
|
837
811
|
* @remarks
|
|
838
812
|
* `plugin.window` is the player's main window: its size, whether it is
|
|
839
|
-
* maximized or fullscreen, picture-in-picture and the video area.
|
|
840
|
-
* changing it needs `window.control`. Changes that last only while the
|
|
813
|
+
* maximized or fullscreen, picture-in-picture and the video area. Changes that last only while the
|
|
841
814
|
* plugin runs (always on top, pointer auto-hide) revert when it stops.
|
|
842
815
|
*
|
|
843
|
-
* @capability None to read; window.control to change; events to follow
|
|
844
|
-
* outside changes.
|
|
845
816
|
* @since 1.0.0
|
|
846
817
|
* @category Plugin
|
|
847
818
|
*/
|
|
@@ -849,14 +820,12 @@ export interface MainWindow {
|
|
|
849
820
|
/** Latest state; zero video area without a native window. */
|
|
850
821
|
readonly state: WindowState;
|
|
851
822
|
/**
|
|
852
|
-
* The window state changed (
|
|
853
|
-
*
|
|
854
|
-
* @capability events (for outside changes)
|
|
823
|
+
* The window state changed (outside changes after `plugin.player.subscribe()`).
|
|
855
824
|
*
|
|
856
825
|
* @example Fit a panel to fullscreen
|
|
857
826
|
* The plugin's panel uses larger text while the player is fullscreen. The
|
|
858
827
|
* listener runs after the SDK updated `state` from the player's events
|
|
859
|
-
* (
|
|
828
|
+
* (after `plugin.player.subscribe()`; without it only after this plugin's own changes).
|
|
860
829
|
* ```ts
|
|
861
830
|
* declare const bar: Panel;
|
|
862
831
|
* // ---cut---
|
|
@@ -877,11 +846,8 @@ export interface MainWindow {
|
|
|
877
846
|
* The visible area excludes the menu bar and Dock on macOS; on Windows it
|
|
878
847
|
* is the whole display. `unavailable` without a user interface too.
|
|
879
848
|
*
|
|
880
|
-
* @capability window.control
|
|
881
849
|
* @throws `unavailable` (rejects) Fullscreen, or no user interface.
|
|
882
850
|
* @throws `invalid` (rejects) A size outside 1–16384 logical points.
|
|
883
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
884
|
-
* `window.control`.
|
|
885
851
|
*
|
|
886
852
|
* @example Make the video area 1280×720 points
|
|
887
853
|
* The window resizes so that the video column is 1280×720 logical points,
|
|
@@ -909,11 +875,8 @@ export interface MainWindow {
|
|
|
909
875
|
* Float the player's windows above other applications. Newest call wins; reverts when this plugin stops.
|
|
910
876
|
* `unavailable` without a user interface.
|
|
911
877
|
*
|
|
912
|
-
* @capability window.control
|
|
913
878
|
* @throws `unavailable` (rejects) No user interface.
|
|
914
879
|
* @throws `invalid` (rejects) `onTop` is not a boolean.
|
|
915
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
916
|
-
* `window.control`.
|
|
917
880
|
*
|
|
918
881
|
* @example Keep the player above other windows
|
|
919
882
|
* The player's windows (tool windows too) float above other applications
|
|
@@ -940,11 +903,8 @@ export interface MainWindow {
|
|
|
940
903
|
* playing, in a window too (not only fullscreen). Newest call wins;
|
|
941
904
|
* reverts to `"fullscreen"` when this plugin stops.
|
|
942
905
|
*
|
|
943
|
-
* @capability window.control
|
|
944
906
|
* @throws `invalid` (rejects) A mode other than `"fullscreen"` or
|
|
945
907
|
* `"playing"`.
|
|
946
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
947
|
-
* `window.control`.
|
|
948
908
|
*
|
|
949
909
|
* @example Hide the pointer over playing video in a window too
|
|
950
910
|
* The pointer disappears after 3 idle seconds over playing video, not only
|
|
@@ -980,15 +940,12 @@ export interface MainWindow {
|
|
|
980
940
|
* await plugin.window.setPictureInPicture(!plugin.window.state.pictureInPicture.active);
|
|
981
941
|
* ```
|
|
982
942
|
*
|
|
983
|
-
* @capability window.control
|
|
984
943
|
* @throws `unsupported` (rejects) The system has no picture-in-picture
|
|
985
944
|
* (`supported` is false).
|
|
986
945
|
* @throws `unavailable` (rejects) No video, or no user interface.
|
|
987
946
|
* @throws `invalid` (rejects) `on` is not a boolean.
|
|
988
947
|
* @throws `busy` (rejects) The previous call is still switching.
|
|
989
948
|
* @throws `failed` (rejects) The system refused.
|
|
990
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
991
|
-
* `window.control`.
|
|
992
949
|
* @since 1.0.0
|
|
993
950
|
*/
|
|
994
951
|
setPictureInPicture(on: boolean): Promise<void>;
|
|
@@ -1020,8 +977,7 @@ export interface AppInfo {
|
|
|
1020
977
|
};
|
|
1021
978
|
}
|
|
1022
979
|
/**
|
|
1023
|
-
* `plugin.app`: the fixed facts plus the system, read on request.
|
|
1024
|
-
* capability.
|
|
980
|
+
* `plugin.app`: the fixed facts plus the system, read on request.
|
|
1025
981
|
*
|
|
1026
982
|
* @example Describe the player and the system for a bug report
|
|
1027
983
|
* The plugin builds a line such as "Vestra 0.5.10 on macOS 26.2" to copy
|
|
@@ -1040,7 +996,6 @@ export interface AppInfo {
|
|
|
1040
996
|
* the displays at each call; the operating system's name and version are
|
|
1041
997
|
* worked out once, at the first call, and reused.
|
|
1042
998
|
*
|
|
1043
|
-
* @capability None.
|
|
1044
999
|
* @since 1.0.0
|
|
1045
1000
|
* @category Plugin
|
|
1046
1001
|
*/
|
|
@@ -1048,9 +1003,8 @@ export interface App extends AppInfo {
|
|
|
1048
1003
|
/**
|
|
1049
1004
|
* The operating system, the displays and the renderer, read when called
|
|
1050
1005
|
* (displays come and go; the renderer can fall back from GPU to software
|
|
1051
|
-
* once).
|
|
1006
|
+
* once). CPU and memory: Node's `os` module.
|
|
1052
1007
|
*
|
|
1053
|
-
* @capability None.
|
|
1054
1008
|
* @throws `busy` (rejects) The player could not start the request (no
|
|
1055
1009
|
* thread available).
|
|
1056
1010
|
*
|
|
@@ -1112,7 +1066,7 @@ export interface SystemInfo {
|
|
|
1112
1066
|
* The plugin adds its HDR command only when the player renders on the GPU,
|
|
1113
1067
|
* instead of creating the render options just to find out from a failed
|
|
1114
1068
|
* status. `system()` asks the player, which reports the renderer drawing at
|
|
1115
|
-
* that moment
|
|
1069
|
+
* that moment.
|
|
1116
1070
|
* ```ts
|
|
1117
1071
|
* const { rendering } = await plugin.app.system();
|
|
1118
1072
|
* if (rendering === "gpu") {
|
|
@@ -1140,8 +1094,8 @@ export interface SystemInfo {
|
|
|
1140
1094
|
* @example Say why the video is drawn in software
|
|
1141
1095
|
* An About page explains a software renderer with the player's own words,
|
|
1142
1096
|
* for example that the graphics driver is on the player's denylist.
|
|
1143
|
-
* `system()` reports the renderer and its reason together
|
|
1144
|
-
*
|
|
1097
|
+
* `system()` reports the renderer and its reason together; the message is
|
|
1098
|
+
* English text that may name the adapter and
|
|
1145
1099
|
* the driver version.
|
|
1146
1100
|
* ```ts
|
|
1147
1101
|
* const { rendering, renderingReason } = await plugin.app.system();
|