@vestra-player/sdk 1.7.20 → 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 +72 -0
- package/README.md +2 -2
- package/bin/vestra-plugin.mjs +139 -100
- package/capability-scan.json +369 -0
- package/dist/api-requests.d.ts +11 -36
- package/dist/api-requests.js +22 -47
- package/dist/capability-scan.d.ts +95 -0
- package/dist/capability-scan.js +249 -0
- package/dist/commands.d.ts +35 -0
- package/dist/commands.js +42 -1
- 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/mpv.d.ts +139 -0
- package/dist/mpv.js +496 -0
- package/dist/player-runtime.d.ts +3 -3
- package/dist/player-runtime.js +3 -3
- 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 +6 -14
- 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.d.ts +3 -0
- package/dist/plugin/mpv.js +91 -0
- 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/scope.d.ts +1 -0
- package/dist/plugin/scope.js +2 -0
- 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 +43 -24
- package/dist/plugin/testing/index.d.ts +75 -114
- package/dist/plugin/testing/index.js +83 -102
- package/dist/plugin/testing/mpv.d.ts +7 -0
- package/dist/plugin/testing/mpv.js +90 -0
- 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 +49 -88
- package/dist/plugin/types/commands.d.ts +44 -77
- package/dist/plugin/types/packages.d.ts +17 -55
- package/dist/plugin/types/playback.d.ts +302 -135
- 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 +22 -12
- package/dist/wire.js +17 -8
- package/llms.txt +5 -5
- package/package.json +4 -3
- package/slint/vestra/widgets.slint +12 -4
- package/dist/capabilities.d.ts +0 -107
- package/dist/capabilities.js +0 -69
- package/dist/capability-check.d.ts +0 -133
- package/dist/capability-check.js +0 -371
- 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 -477
|
@@ -27,7 +27,6 @@ import type { Disposable } from "./base.ts";
|
|
|
27
27
|
* The player reads and writes the system clipboard on the plugin's behalf.
|
|
28
28
|
* Text is plain text; images are written from a PNG or JPEG file.
|
|
29
29
|
*
|
|
30
|
-
* @capability clipboard
|
|
31
30
|
* @since 1.0.0
|
|
32
31
|
* @category Services
|
|
33
32
|
*/
|
|
@@ -35,12 +34,9 @@ export interface Clipboard {
|
|
|
35
34
|
/**
|
|
36
35
|
* Plain text on the clipboard; `null` when it holds none.
|
|
37
36
|
*
|
|
38
|
-
* @capability clipboard
|
|
39
37
|
* @throws `unavailable` (rejects) The player runs without a user interface.
|
|
40
38
|
* @throws `unsupported` (rejects) A system other than macOS and Windows.
|
|
41
39
|
* @throws `failed` (rejects) The system refused (Windows).
|
|
42
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
43
|
-
* `clipboard`.
|
|
44
40
|
*
|
|
45
41
|
* @example Open a URL the user copied
|
|
46
42
|
* A "Paste and play" command opens the address on the clipboard. `readText`
|
|
@@ -57,13 +53,10 @@ export interface Clipboard {
|
|
|
57
53
|
/**
|
|
58
54
|
* Replace the clipboard with text (at most 1 MiB of UTF-8).
|
|
59
55
|
*
|
|
60
|
-
* @capability clipboard
|
|
61
56
|
* @throws `invalid` (rejects) More than 1 MiB of UTF-8.
|
|
62
57
|
* @throws `unavailable` (rejects) The player runs without a user interface.
|
|
63
58
|
* @throws `unsupported` (rejects) A system other than macOS and Windows.
|
|
64
59
|
* @throws `failed` (rejects) The system refused.
|
|
65
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
66
|
-
* `clipboard`.
|
|
67
60
|
*
|
|
68
61
|
* @example Copy the playing file's path
|
|
69
62
|
* The path of the playing file is put on the clipboard, replacing what was
|
|
@@ -79,15 +72,12 @@ export interface Clipboard {
|
|
|
79
72
|
/**
|
|
80
73
|
* Replace the clipboard with a PNG or JPEG file (absolute path, at most 16 MB).
|
|
81
74
|
*
|
|
82
|
-
* @capability clipboard
|
|
83
75
|
* @throws `missing` (rejects) The file does not exist.
|
|
84
76
|
* @throws `invalid` (rejects) Not an absolute path, not PNG or JPEG, over
|
|
85
77
|
* 16 MB, or (Windows) an image the system cannot decode.
|
|
86
78
|
* @throws `unavailable` (rejects) The player runs without a user interface.
|
|
87
79
|
* @throws `unsupported` (rejects) A system other than macOS and Windows.
|
|
88
80
|
* @throws `failed` (rejects) The system refused.
|
|
89
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
90
|
-
* `clipboard`.
|
|
91
81
|
*
|
|
92
82
|
* @example Copy a snapshot to the clipboard
|
|
93
83
|
* A frame the plugin saved as PNG is put on the clipboard, ready to paste
|
|
@@ -105,15 +95,13 @@ export interface Clipboard {
|
|
|
105
95
|
writeImage(path: string): Promise<void>;
|
|
106
96
|
}
|
|
107
97
|
/**
|
|
108
|
-
* Keeping the computer awake
|
|
98
|
+
* Keeping the computer awake.
|
|
109
99
|
*
|
|
110
100
|
* @remarks
|
|
111
101
|
* A request, not a command: the player keeps the system awake while any
|
|
112
102
|
* plugin asks for it and a source plays, and withdraws a plugin's request
|
|
113
103
|
* when it stops.
|
|
114
104
|
*
|
|
115
|
-
* @capability playback.control
|
|
116
|
-
*
|
|
117
105
|
* @example Keep the display on while playing
|
|
118
106
|
* The screen does not dim or sleep while a video plays, and may again when
|
|
119
107
|
* it is paused or ends. The player takes the system's assertion only while
|
|
@@ -136,10 +124,7 @@ export interface Power {
|
|
|
136
124
|
* macOS uses `caffeinate`, Windows the thread execution state; elsewhere
|
|
137
125
|
* it has no effect.
|
|
138
126
|
*
|
|
139
|
-
* @capability playback.control
|
|
140
127
|
* @throws `invalid` (rejects) A mode other than `"off"` or `"playing"`.
|
|
141
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
142
|
-
* `playback.control`.
|
|
143
128
|
*
|
|
144
129
|
* @example Follow the plugin's own "Keep awake" setting
|
|
145
130
|
* The plugin keeps the display awake during playback only while its
|
|
@@ -168,8 +153,7 @@ export interface ToolResult {
|
|
|
168
153
|
stderr: string;
|
|
169
154
|
}
|
|
170
155
|
/**
|
|
171
|
-
* `plugin.tools`: ffmpeg and ffprobe, run in this plugin's process.
|
|
172
|
-
* capability.
|
|
156
|
+
* `plugin.tools`: ffmpeg and ffprobe, run in this plugin's process.
|
|
173
157
|
*
|
|
174
158
|
* @example Read a file's format with ffprobe
|
|
175
159
|
* The plugin gets a media file's container details as JSON. `available`
|
|
@@ -199,7 +183,6 @@ export interface ToolResult {
|
|
|
199
183
|
* again next time. Disposing the
|
|
200
184
|
* scope ends a running process.
|
|
201
185
|
*
|
|
202
|
-
* @capability None.
|
|
203
186
|
* @since 1.0.0
|
|
204
187
|
* @category Services
|
|
205
188
|
*/
|
|
@@ -215,7 +198,6 @@ export interface Tools {
|
|
|
215
198
|
* honoured. Ending sends SIGTERM, then SIGKILL after 300 ms (immediate on
|
|
216
199
|
* Windows).
|
|
217
200
|
*
|
|
218
|
-
* @capability None.
|
|
219
201
|
* @throws `unavailable` (rejects) The tool was not found.
|
|
220
202
|
* @throws `timeout` (rejects) It ran longer than `timeoutMs`; the process is
|
|
221
203
|
* ended.
|
|
@@ -251,7 +233,6 @@ export interface Tools {
|
|
|
251
233
|
/**
|
|
252
234
|
* Whether the tool can be found.
|
|
253
235
|
*
|
|
254
|
-
* @capability None.
|
|
255
236
|
* @throws Never; it resolves `false` when the tool cannot be found.
|
|
256
237
|
*
|
|
257
238
|
* @example Grey out a command when ffmpeg is missing
|
|
@@ -286,8 +267,6 @@ export interface Tools {
|
|
|
286
267
|
* newest last. Disposing the store, its scope or stopping the plugin
|
|
287
268
|
* writes a pending save first.
|
|
288
269
|
*
|
|
289
|
-
* @capability None.
|
|
290
|
-
*
|
|
291
270
|
* @example Count how often the plugin was started
|
|
292
271
|
* The counter grows by one at every start and is kept in `stats.json`. The
|
|
293
272
|
* store reads the file when it is made (the defaults when there is none),
|
|
@@ -307,8 +286,6 @@ export interface JsonStore<T> extends Disposable {
|
|
|
307
286
|
* Replace the value now and write it after `debounceMs`.
|
|
308
287
|
* Only `save` writes: mutating `value` in place is not saved.
|
|
309
288
|
*
|
|
310
|
-
* @capability None.
|
|
311
|
-
*
|
|
312
289
|
* @example Save a slider value without writing on every move
|
|
313
290
|
* Dragging the plugin's volume slider updates the stored value at once but
|
|
314
291
|
* writes the file only once the user stops for 300 ms. Each `save`
|
|
@@ -326,7 +303,6 @@ export interface JsonStore<T> extends Disposable {
|
|
|
326
303
|
/**
|
|
327
304
|
* Write a pending save now.
|
|
328
305
|
*
|
|
329
|
-
* @capability None.
|
|
330
306
|
* @throws `Error` (rejects) Node's file system error when the file cannot
|
|
331
307
|
* be written; its `code` is Node's (`ENOSPC`, `EACCES` and so on), not a
|
|
332
308
|
* player error code.
|
|
@@ -350,19 +326,16 @@ export interface JsonStore<T> extends Disposable {
|
|
|
350
326
|
flush(): Promise<void>;
|
|
351
327
|
}
|
|
352
328
|
/**
|
|
353
|
-
* `plugin.storage`: JSON settings files.
|
|
329
|
+
* `plugin.storage`: JSON settings files.
|
|
354
330
|
*
|
|
355
331
|
* @remarks
|
|
356
|
-
* Two kinds of storage, both private to the plugin
|
|
357
|
-
* capability. {@link Storage.json} keeps settings in JSON files in the
|
|
332
|
+
* Two kinds of storage, both private to the plugin. {@link Storage.json} keeps settings in JSON files in the
|
|
358
333
|
* plugin's data directory: they last across player restarts and upgrades,
|
|
359
334
|
* and are written by the plugin's own process. {@link Storage.session}
|
|
360
335
|
* keeps values in the player's memory for one player run: they survive a
|
|
361
336
|
* restart of the plugin's process but not of the player. Secrets belong in
|
|
362
337
|
* {@link Secrets}, never in either.
|
|
363
338
|
*
|
|
364
|
-
* @capability None.
|
|
365
|
-
*
|
|
366
339
|
* @example Keep a setting across restarts and a queue for this run
|
|
367
340
|
* The plugin's step size survives a restart of the player; its work queue
|
|
368
341
|
* survives a reload of the plugin but starts empty with the next player
|
|
@@ -408,7 +381,6 @@ export interface Storage {
|
|
|
408
381
|
* store.save({ ...store.value, recent: [path, ...store.value.recent].slice(0, 10) });
|
|
409
382
|
* ```
|
|
410
383
|
*
|
|
411
|
-
* @capability None.
|
|
412
384
|
* @throws `invalid` (throws) A bad `name`, or a `debounceMs` that is not a
|
|
413
385
|
* non-negative number.
|
|
414
386
|
* @since 1.0.0
|
|
@@ -429,8 +401,7 @@ export interface Storage {
|
|
|
429
401
|
}
|
|
430
402
|
/**
|
|
431
403
|
* `plugin.storage.session`: JSON values that live as long as the **player**,
|
|
432
|
-
* not as long as the plugin's process (like `chrome.storage.session`).
|
|
433
|
-
* capability.
|
|
404
|
+
* not as long as the plugin's process (like `chrome.storage.session`).
|
|
434
405
|
*
|
|
435
406
|
* `activate` can run more than once in one player session: the player stops
|
|
436
407
|
* and starts a plugin's process again when the plugin is reloaded (also a
|
|
@@ -446,7 +417,7 @@ export interface Storage {
|
|
|
446
417
|
* | --- | --- |
|
|
447
418
|
* | The plugin's process restarts: reload, upgrade, crash | kept |
|
|
448
419
|
* | The plugin failed to start or failed, and starts again | kept |
|
|
449
|
-
* | The user, or a plugin
|
|
420
|
+
* | The user, or a plugin that manages plugins (`packages.setEnabled(id, false)`), disables the plugin | cleared |
|
|
450
421
|
* | An update or reinstall with `enabled: false` switches an enabled plugin off | cleared |
|
|
451
422
|
* | The plugin is uninstalled | cleared |
|
|
452
423
|
* | An earlier installation kept for a later reinstall (after a `replace`) is dropped because the player keeps only so many | cleared |
|
|
@@ -494,14 +465,12 @@ export interface Storage {
|
|
|
494
465
|
* quits; the plugin's process may restart in between. Each call is one
|
|
495
466
|
* request to the player, answered in order, with no debounce.
|
|
496
467
|
*
|
|
497
|
-
* @capability None.
|
|
498
468
|
* @category Services
|
|
499
469
|
*/
|
|
500
470
|
export interface SessionStorage {
|
|
501
471
|
/**
|
|
502
472
|
* The value stored under `key`, or `undefined` when there is none.
|
|
503
473
|
*
|
|
504
|
-
* @capability None.
|
|
505
474
|
* @throws `invalid` (rejects) A bad key (empty, over 1024 bytes, with NUL
|
|
506
475
|
* or a lone surrogate).
|
|
507
476
|
* @throws `disabled` (rejects) The plugin is stopping.
|
|
@@ -525,7 +494,6 @@ export interface SessionStorage {
|
|
|
525
494
|
* that is not JSON, `limit` when the plugin's values would be over 1 MiB
|
|
526
495
|
* or the request over the 1 MiB message limit.
|
|
527
496
|
*
|
|
528
|
-
* @capability None.
|
|
529
497
|
* @throws `invalid` (rejects) A bad key, or a value JSON cannot hold (or a
|
|
530
498
|
* string with a lone surrogate).
|
|
531
499
|
* @throws `disabled` (rejects) The plugin is stopping.
|
|
@@ -547,7 +515,6 @@ export interface SessionStorage {
|
|
|
547
515
|
/**
|
|
548
516
|
* Remove a key; removing a missing one is fine.
|
|
549
517
|
*
|
|
550
|
-
* @capability None.
|
|
551
518
|
* @throws `invalid` (rejects) A bad key.
|
|
552
519
|
* @throws `disabled` (rejects) The plugin is stopping.
|
|
553
520
|
* @throws `unsupported` (rejects) A player before 0.5.5.
|
|
@@ -565,7 +532,6 @@ export interface SessionStorage {
|
|
|
565
532
|
/**
|
|
566
533
|
* The keys stored, in code point order.
|
|
567
534
|
*
|
|
568
|
-
* @capability None.
|
|
569
535
|
* @throws `disabled` (rejects) The plugin is stopping.
|
|
570
536
|
* @throws `unsupported` (rejects) A player before 0.5.5.
|
|
571
537
|
*
|
|
@@ -582,7 +548,7 @@ export interface SessionStorage {
|
|
|
582
548
|
keys(): Promise<string[]>;
|
|
583
549
|
}
|
|
584
550
|
/**
|
|
585
|
-
* `plugin.system`: files and links, executed by the player.
|
|
551
|
+
* `plugin.system`: files and links, executed by the player.
|
|
586
552
|
* Other systems than macOS and Windows: `unsupported`.
|
|
587
553
|
*
|
|
588
554
|
* @example Show an exported file and open the help page
|
|
@@ -607,7 +573,6 @@ export interface SessionStorage {
|
|
|
607
573
|
* applications for the plugin, so the plugin never runs `open`,
|
|
608
574
|
* `explorer` or a shell itself.
|
|
609
575
|
*
|
|
610
|
-
* @capability None.
|
|
611
576
|
* @since 1.0.0
|
|
612
577
|
* @category Services
|
|
613
578
|
*/
|
|
@@ -618,7 +583,6 @@ export interface System {
|
|
|
618
583
|
* one Explorer window per folder, selecting its first path). Paths that do
|
|
619
584
|
* not exist are skipped; `missing` when none exists; at most 256.
|
|
620
585
|
*
|
|
621
|
-
* @capability None.
|
|
622
586
|
* @throws `missing` (rejects) None of the paths exists.
|
|
623
587
|
* @throws `invalid` (rejects) No paths, or more than 256.
|
|
624
588
|
* @throws `failed` (rejects) The system refused.
|
|
@@ -641,7 +605,6 @@ export interface System {
|
|
|
641
605
|
/**
|
|
642
606
|
* Open the file or folder with its default application. `missing` if absent.
|
|
643
607
|
*
|
|
644
|
-
* @capability None.
|
|
645
608
|
* @throws `missing` (rejects) The path does not exist.
|
|
646
609
|
* @throws `invalid` (rejects) An empty path.
|
|
647
610
|
* @throws `failed` (rejects) The system refused.
|
|
@@ -662,7 +625,6 @@ export interface System {
|
|
|
662
625
|
* Open an http(s) address in the default browser. `invalid` for another
|
|
663
626
|
* protocol or a malformed address; `timeout` after 10 s, `failed` otherwise.
|
|
664
627
|
*
|
|
665
|
-
* @capability None.
|
|
666
628
|
* @throws `invalid` (rejects) Not an `http:` or `https:` address.
|
|
667
629
|
* @throws `timeout` (rejects) macOS did not hand it to the browser within
|
|
668
630
|
* 10 s.
|
|
@@ -718,7 +680,6 @@ export interface System {
|
|
|
718
680
|
* `a-z 0-9 . _ -`, values 1–1024 bytes of text, at most 256 names per
|
|
719
681
|
* plugin (`SECRET_LIMITS`).
|
|
720
682
|
*
|
|
721
|
-
* @capability secrets
|
|
722
683
|
* @since 1.0.0
|
|
723
684
|
* @category Services
|
|
724
685
|
*/
|
|
@@ -726,14 +687,11 @@ export interface Secrets {
|
|
|
726
687
|
/**
|
|
727
688
|
* The stored value, `null` when there is none.
|
|
728
689
|
*
|
|
729
|
-
* @capability secrets
|
|
730
690
|
* @throws `unsupported` (rejects) The system has no secret store.
|
|
731
691
|
* @throws `unavailable` (rejects) The store cannot be reached (no keychain,
|
|
732
692
|
* a read-only store, no logged-in session on Windows).
|
|
733
693
|
* @throws `failed` (rejects) The user denied access, or another system
|
|
734
694
|
* error.
|
|
735
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
736
|
-
* `secrets`.
|
|
737
695
|
* @throws `invalid` (rejects) A bad name.
|
|
738
696
|
*
|
|
739
697
|
* @example Read a stored token
|
|
@@ -752,7 +710,6 @@ export interface Secrets {
|
|
|
752
710
|
* At most 256 different names per plugin: a new name beyond that rejects
|
|
753
711
|
* `limit`. Uninstalling with `removeData` deletes them.
|
|
754
712
|
*
|
|
755
|
-
* @capability secrets
|
|
756
713
|
* @throws `invalid` (rejects) A bad name, or a value that is empty, has NUL
|
|
757
714
|
* or is over 1024 bytes.
|
|
758
715
|
* @throws `limit` (rejects) A new name beyond 256.
|
|
@@ -761,8 +718,6 @@ export interface Secrets {
|
|
|
761
718
|
* a read-only store, no logged-in session on Windows).
|
|
762
719
|
* @throws `failed` (rejects) The user denied access, or another system
|
|
763
720
|
* error.
|
|
764
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
765
|
-
* `secrets`.
|
|
766
721
|
*
|
|
767
722
|
* @example Save the token the user entered
|
|
768
723
|
* The token the user typed is kept in the system's secret store for later
|
|
@@ -783,15 +738,12 @@ export interface Secrets {
|
|
|
783
738
|
/**
|
|
784
739
|
* Remove; removing a missing secret is fine.
|
|
785
740
|
*
|
|
786
|
-
* @capability secrets
|
|
787
741
|
* @throws `invalid` (rejects) A bad name.
|
|
788
742
|
* @throws `unsupported` (rejects) The system has no secret store.
|
|
789
743
|
* @throws `unavailable` (rejects) The store cannot be reached (no keychain,
|
|
790
744
|
* a read-only store, no logged-in session on Windows).
|
|
791
745
|
* @throws `failed` (rejects) The user denied access, or another system
|
|
792
746
|
* error.
|
|
793
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
794
|
-
* `secrets`.
|
|
795
747
|
*
|
|
796
748
|
* @example Sign out by removing the token
|
|
797
749
|
* Signing out removes the stored token, so the next start asks again.
|
|
@@ -967,9 +919,8 @@ export interface RenderingState {
|
|
|
967
919
|
};
|
|
968
920
|
}
|
|
969
921
|
/**
|
|
970
|
-
* `plugin.rendering`: the player's rendering choice, GPU or software
|
|
971
|
-
*
|
|
972
|
-
* the player need `rendering.manage`.
|
|
922
|
+
* `plugin.rendering`: the player's rendering choice, GPU or software: read
|
|
923
|
+
* it, change the saved choice, restart the player.
|
|
973
924
|
*
|
|
974
925
|
* @remarks
|
|
975
926
|
* The choice works like a browser's hardware acceleration switch: the
|
|
@@ -1007,8 +958,6 @@ export interface RenderingState {
|
|
|
1007
958
|
* });
|
|
1008
959
|
* ```
|
|
1009
960
|
*
|
|
1010
|
-
* @capability None to read the state; `rendering.manage` to change the
|
|
1011
|
-
* choice or restart the player.
|
|
1012
961
|
* @see [Offer a GPU rendering switch](../../../docs/guides/gpu-rendering.md)
|
|
1013
962
|
* @player 0.5.13
|
|
1014
963
|
* @since 1.5.35
|
|
@@ -1017,9 +966,8 @@ export interface RenderingState {
|
|
|
1017
966
|
export interface Rendering {
|
|
1018
967
|
/**
|
|
1019
968
|
* Read the renderer drawing now, the saved choice, what the next start
|
|
1020
|
-
* will use and whether `"gpu"` can be chosen.
|
|
969
|
+
* will use and whether `"gpu"` can be chosen.
|
|
1021
970
|
*
|
|
1022
|
-
* @capability None.
|
|
1023
971
|
* @throws `unsupported` (rejects) A player before 0.5.13, which does not
|
|
1024
972
|
* know the request.
|
|
1025
973
|
*
|
|
@@ -1049,7 +997,6 @@ export interface Rendering {
|
|
|
1049
997
|
* @returns The new state; {@link RenderingState.restartPending} tells
|
|
1050
998
|
* whether a restart would change the renderer.
|
|
1051
999
|
*
|
|
1052
|
-
* @capability rendering.manage
|
|
1053
1000
|
* @throws `invalid` (rejects) `preference` is not `"auto"`, `"gpu"` or
|
|
1054
1001
|
* `"software"`.
|
|
1055
1002
|
* @throws `unsupported` (rejects) `"gpu"` where this player has no GPU
|
|
@@ -1060,8 +1007,6 @@ export interface Rendering {
|
|
|
1060
1007
|
* at an earlier start. The message says which, with the adapter's name
|
|
1061
1008
|
* and the driver version.
|
|
1062
1009
|
* @throws `failed` (rejects) The player could not write its settings file.
|
|
1063
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
1064
|
-
* `rendering.manage`.
|
|
1065
1010
|
*
|
|
1066
1011
|
* @example Switch back to the automatic choice
|
|
1067
1012
|
* A Reset item returns the renderer to the player's own choice and tells
|
|
@@ -1090,7 +1035,6 @@ export interface Rendering {
|
|
|
1090
1035
|
* or playing as it was; a stream or another source that is not a file is
|
|
1091
1036
|
* not reopened.
|
|
1092
1037
|
*
|
|
1093
|
-
* @capability rendering.manage
|
|
1094
1038
|
* @throws `unsupported` (rejects) The player runs without a user
|
|
1095
1039
|
* interface; also a player before 0.5.13.
|
|
1096
1040
|
* @throws `busy` (rejects) A restart is already under way, or this player
|
|
@@ -1098,13 +1042,10 @@ export interface Rendering {
|
|
|
1098
1042
|
* that restarts on activation cannot make a loop).
|
|
1099
1043
|
* @throws `failed` (rejects) The new player process could not be started;
|
|
1100
1044
|
* the player keeps running.
|
|
1101
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
1102
|
-
* `rendering.manage`.
|
|
1103
1045
|
*
|
|
1104
1046
|
* @example Restart after asking the user
|
|
1105
1047
|
* After the user changed the renderer, the plugin offers to restart now.
|
|
1106
|
-
* `confirm` asks first, because a restart closes every window
|
|
1107
|
-
* `ui.dialog`); once `restartPlayer` resolves, the player is quitting and
|
|
1048
|
+
* `confirm` asks first, because a restart closes every window; once `restartPlayer` resolves, the player is quitting and
|
|
1108
1049
|
* will stop this plugin, so nothing else is started after it.
|
|
1109
1050
|
* ```ts
|
|
1110
1051
|
* const { confirmed } = await plugin.dialogs.confirm({
|
|
@@ -30,8 +30,6 @@ export interface CaptureOptions extends Conditional {
|
|
|
30
30
|
* times and playback is unaffected. Disposing it releases the player's
|
|
31
31
|
* copy; an export using it after that fails with `released`.
|
|
32
32
|
*
|
|
33
|
-
* @capability media.read and media.control
|
|
34
|
-
*
|
|
35
33
|
* @example Export one frame as PNG and as JPEG
|
|
36
34
|
* The same frozen frame is written twice, lossless and compressed. Each
|
|
37
35
|
* `export` starts a job of its own; the snapshot is released after both
|
|
@@ -91,7 +89,6 @@ export interface Snapshot extends Disposable {
|
|
|
91
89
|
* make (no video stream, a cover image, an external audio track, codecs `mp4`
|
|
92
90
|
* cannot hold) ends `failed` with the code `unsupported`.
|
|
93
91
|
*
|
|
94
|
-
* @capability media.read and media.control
|
|
95
92
|
* @throws `released` (rejects) The snapshot was already released.
|
|
96
93
|
* @throws `invalid` (rejects) Bad options (`quality` outside 1–100, a
|
|
97
94
|
* relative destination, a clip `end` not after the snapshot time or
|
|
@@ -100,8 +97,6 @@ export interface Snapshot extends Disposable {
|
|
|
100
97
|
* @throws `busy` (rejects) This plugin runs 2 exports (or the player 8).
|
|
101
98
|
* @throws `unavailable` (rejects) No FFmpeg, or the export worker could not
|
|
102
99
|
* start.
|
|
103
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
104
|
-
* `media.read` and `media.control`.
|
|
105
100
|
*
|
|
106
101
|
* @example Export a 30-second clip
|
|
107
102
|
* A clip from the snapshot time to 30 seconds later is written as MP4.
|
|
@@ -314,8 +309,6 @@ export type JobState = Omit<MediaJob, "jobId">;
|
|
|
314
309
|
* rejects for a failed export: the failure is in `outcome`. Disposing an
|
|
315
310
|
* unfinished job cancels it.
|
|
316
311
|
*
|
|
317
|
-
* @capability media.read and media.control
|
|
318
|
-
*
|
|
319
312
|
* @example Show export progress and cancel on request
|
|
320
313
|
* The OSD shows the job's status while it runs, and a Cancel command stops
|
|
321
314
|
* it. `onChange` follows the state (`queued`, `running`, `cancelling`,
|
|
@@ -339,8 +332,6 @@ export interface ExportJob extends Disposable {
|
|
|
339
332
|
/**
|
|
340
333
|
* The state changed.
|
|
341
334
|
*
|
|
342
|
-
* @capability media.read
|
|
343
|
-
*
|
|
344
335
|
* @example Log each state of an export
|
|
345
336
|
* The plugin's log records each status the job goes through (`queued`,
|
|
346
337
|
* `running`, `cancelling` after a cancel, then a terminal one). The listener runs when the SDK learns a
|
|
@@ -363,10 +354,7 @@ export interface ExportJob extends Disposable {
|
|
|
363
354
|
/**
|
|
364
355
|
* Ask to cancel: `requested`, `tooLate` (already publishing) or `terminal` (already over).
|
|
365
356
|
*
|
|
366
|
-
* @capability media.control
|
|
367
357
|
* @throws `rejected` (rejects) The player did not accept the request.
|
|
368
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
369
|
-
* `media.control`.
|
|
370
358
|
*
|
|
371
359
|
* @example Cancel an export the user no longer wants
|
|
372
360
|
* The running export stops, unless it is already writing its file.
|
|
@@ -386,10 +374,6 @@ export interface ExportJob extends Disposable {
|
|
|
386
374
|
/**
|
|
387
375
|
* Read the state from the player now.
|
|
388
376
|
*
|
|
389
|
-
* @capability media.read
|
|
390
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
391
|
-
* `media.read`.
|
|
392
|
-
*
|
|
393
377
|
* @example Read a job's state now
|
|
394
378
|
* The plugin reads the newest state of an export without waiting for an
|
|
395
379
|
* event. `refresh` asks the player and resolves with the state, which
|
|
@@ -401,14 +385,13 @@ export interface ExportJob extends Disposable {
|
|
|
401
385
|
* console.log(state.status);
|
|
402
386
|
* ```
|
|
403
387
|
*
|
|
388
|
+
* @throws `disabled` (rejects) The plugin is stopping.
|
|
404
389
|
* @since 1.0.0
|
|
405
390
|
*/
|
|
406
391
|
refresh(): Promise<JobState>;
|
|
407
392
|
}
|
|
408
393
|
/**
|
|
409
|
-
* `plugin.media`: snapshots and exports.
|
|
410
|
-
* `media.control` (processed snapshots also `playback.read` and
|
|
411
|
-
* `subtitles.read`). Exports decode offline and do not disturb playback.
|
|
394
|
+
* `plugin.media`: snapshots and exports. Exports decode offline and do not disturb playback.
|
|
412
395
|
*
|
|
413
396
|
* @example Save the current frame as JPEG
|
|
414
397
|
* The frame on screen, with the plugin's own picture effects, is saved
|
|
@@ -438,8 +421,6 @@ export interface ExportJob extends Disposable {
|
|
|
438
421
|
* holds at most 4 snapshots at a time (16 in the player); release them
|
|
439
422
|
* when done.
|
|
440
423
|
*
|
|
441
|
-
* @capability media.read and media.control (processed snapshots also
|
|
442
|
-
* `playback.read` and `subtitles.read`)
|
|
443
424
|
* @since 1.0.0
|
|
444
425
|
* @category Media
|
|
445
426
|
*/
|
|
@@ -451,7 +432,6 @@ export interface MediaCapture {
|
|
|
451
432
|
* plain SRT text can) or a picture over the size limits; `noSource` when
|
|
452
433
|
* nothing is playing.
|
|
453
434
|
*
|
|
454
|
-
* @capability media.read and media.control
|
|
455
435
|
* @throws `stale` (rejects) The source changed since `ifCurrent`.
|
|
456
436
|
* @throws `noSource` (rejects) Nothing is playing.
|
|
457
437
|
* @throws `invalid` (rejects) `at` at or after the end of the source.
|
|
@@ -462,8 +442,6 @@ export interface MediaCapture {
|
|
|
462
442
|
* @throws `unsupported` (rejects) A processed snapshot the player cannot
|
|
463
443
|
* freeze: subtitles that cannot be flattened (only plain SRT text can),
|
|
464
444
|
* or a picture over the size limits.
|
|
465
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
466
|
-
* `media.read` and `media.control`.
|
|
467
445
|
*
|
|
468
446
|
* @example Freeze the frame at the 10-second mark
|
|
469
447
|
* The plugin freezes the frame at 0:10 of the open file, raw, to export it
|
|
@@ -487,7 +465,6 @@ export interface MediaCapture {
|
|
|
487
465
|
* restarts, for exports made later ({@link MediaCapture.export}) and for
|
|
488
466
|
* opening them again ({@link MediaSources.open}).
|
|
489
467
|
*
|
|
490
|
-
* @capability media.sources
|
|
491
468
|
* @since 1.7.8
|
|
492
469
|
*/
|
|
493
470
|
readonly sources: MediaSources;
|
|
@@ -524,8 +501,6 @@ export interface MediaCapture {
|
|
|
524
501
|
* written so far, and what a crash leaves in the temporary folder goes
|
|
525
502
|
* at the player's next start.
|
|
526
503
|
*
|
|
527
|
-
* @capability media.read and media.control, and media.sources (its
|
|
528
|
-
* tokens)
|
|
529
504
|
* @throws `invalid` (rejects) No part or more than 100, a part whose end
|
|
530
505
|
* is not after its start, parts longer than 24 hours in all, a relative
|
|
531
506
|
* destination, `encoding` with `copy` or `container` with `mp4`, an
|
|
@@ -535,8 +510,6 @@ export interface MediaCapture {
|
|
|
535
510
|
* @throws `busy` (rejects) This plugin runs 2 exports (or the player 8).
|
|
536
511
|
* @throws `unavailable` (rejects) No FFmpeg, or the export worker could not
|
|
537
512
|
* start.
|
|
538
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
539
|
-
* `media.control` and `media.sources`.
|
|
540
513
|
*
|
|
541
514
|
* @example Export two ranges of remembered files as one file
|
|
542
515
|
* Two parts from two files become one file, copied as they are when the
|
|
@@ -578,7 +551,6 @@ export interface MediaCapture {
|
|
|
578
551
|
* (nothing is decoded, so it is cheap enough to run on every change of
|
|
579
552
|
* a list); for a snapshot it reads the held file's streams.
|
|
580
553
|
*
|
|
581
|
-
* @capability media.control, and media.sources for parts
|
|
582
554
|
* @throws `invalid` (rejects) No part or more than 100, a time that is
|
|
583
555
|
* negative, past 24 hours (24 hours in all) or not finite, a snapshot
|
|
584
556
|
* `end` not after its time or past its duration, an invalid
|
|
@@ -586,8 +558,6 @@ export interface MediaCapture {
|
|
|
586
558
|
* @throws `released` (rejects) The snapshot was released.
|
|
587
559
|
* @throws `busy` (rejects) This plugin has 4 checks or source requests
|
|
588
560
|
* running.
|
|
589
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
590
|
-
* `media.control` (and `media.sources` for parts).
|
|
591
561
|
*
|
|
592
562
|
* @example Say why the fast export is not possible
|
|
593
563
|
* The plugin shows a line under its list when the parts need a
|
|
@@ -685,7 +655,7 @@ export interface SourceReference {
|
|
|
685
655
|
*
|
|
686
656
|
* @remarks
|
|
687
657
|
* Tokens hide paths as an API convenience, not as a security boundary:
|
|
688
|
-
* while the file plays, `player.state.source`
|
|
658
|
+
* while the file plays, `player.state.source` shows its
|
|
689
659
|
* path, and a plugin is an ordinary Node.js process, not sandboxed from
|
|
690
660
|
* the file system, that can find files by other means. What a token gives is a
|
|
691
661
|
* way to name the user's files without the plugin keeping their paths,
|
|
@@ -701,8 +671,6 @@ export interface SourceReference {
|
|
|
701
671
|
* When a file has moved, {@link MediaSources.locate} lets the user find it
|
|
702
672
|
* again in the player's own file dialog.
|
|
703
673
|
*
|
|
704
|
-
* @capability media.sources
|
|
705
|
-
*
|
|
706
674
|
* @example Remember the playing file and check it later
|
|
707
675
|
* The plugin keeps the token in its storage and checks the file before
|
|
708
676
|
* using it. `remember` answers for the file playing now; `get` looks at
|
|
@@ -725,7 +693,6 @@ export interface MediaSources {
|
|
|
725
693
|
* file as it is). Fails `unsupported` for a stream, an address or a
|
|
726
694
|
* plugin's picture, `stale` when the source changed since `ifCurrent`.
|
|
727
695
|
*
|
|
728
|
-
* @capability media.sources
|
|
729
696
|
* @throws `unsupported` (rejects) The source is not a local file, or the
|
|
730
697
|
* player cannot read its streams.
|
|
731
698
|
* @throws `stale` (rejects) The source changed since `ifCurrent`.
|
|
@@ -733,15 +700,13 @@ export interface MediaSources {
|
|
|
733
700
|
* @throws `busy` (rejects) This plugin has 4 source requests or checks
|
|
734
701
|
* running; try again when one has answered.
|
|
735
702
|
* @throws `unavailable` (rejects) No FFmpeg to read the file with.
|
|
736
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
737
|
-
* `media.sources`.
|
|
738
703
|
*
|
|
739
704
|
* @example Add the marked range to a list, with a thumbnail
|
|
740
705
|
* The range the user marked becomes a part of the plugin's list. The
|
|
741
706
|
* token stands for the file; the plugin keeps it with the times, and the
|
|
742
707
|
* name is what the list shows. There is no thumbnail API: while the file
|
|
743
708
|
* plays, the plugin captures the part's first frame
|
|
744
|
-
* ({@link MediaCapture.capture}
|
|
709
|
+
* ({@link MediaCapture.capture}) and
|
|
745
710
|
* exports it into its own data directory; `plugin.ui.image` shows it
|
|
746
711
|
* scaled down.
|
|
747
712
|
* ```ts
|
|
@@ -768,12 +733,9 @@ export interface MediaSources {
|
|
|
768
733
|
* The reference with its file looked at now: `status` says whether it
|
|
769
734
|
* is still there as it was.
|
|
770
735
|
*
|
|
771
|
-
* @capability media.sources
|
|
772
736
|
* @throws `missing` (rejects) Not one of this plugin's tokens.
|
|
773
737
|
* @throws `busy` (rejects) This plugin has 4 source requests or checks
|
|
774
738
|
* running; try again when one has answered.
|
|
775
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
776
|
-
* `media.sources`.
|
|
777
739
|
*
|
|
778
740
|
* @example Mark the parts whose file is gone
|
|
779
741
|
* At start the plugin checks each remembered file once. A part whose file
|
|
@@ -796,15 +758,12 @@ export interface MediaSources {
|
|
|
796
758
|
* user picks a file, the token stands for that file from then on.
|
|
797
759
|
* Resolves `null` when the user cancels.
|
|
798
760
|
*
|
|
799
|
-
* @capability media.sources
|
|
800
761
|
* @throws `missing` (rejects) Not one of this plugin's tokens.
|
|
801
762
|
* @throws `busy` (rejects) Another dialog of the player is open, or this
|
|
802
763
|
* plugin showed a Locate dialog less than 2 seconds ago.
|
|
803
764
|
* @throws `unavailable` (rejects) No window to show the dialog in.
|
|
804
765
|
* @throws `unsupported` (rejects) The player cannot read the chosen file's
|
|
805
766
|
* streams.
|
|
806
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
807
|
-
* `media.sources`.
|
|
808
767
|
*
|
|
809
768
|
* @example Locate a moved file
|
|
810
769
|
* The row's Locate… button asks the user for the file. The token keeps
|
|
@@ -822,10 +781,6 @@ export interface MediaSources {
|
|
|
822
781
|
/**
|
|
823
782
|
* The player forgets the token (an unknown one is ignored).
|
|
824
783
|
*
|
|
825
|
-
* @capability media.sources
|
|
826
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
827
|
-
* `media.sources`.
|
|
828
|
-
*
|
|
829
784
|
* @example Forget a file no part uses any more
|
|
830
785
|
* When the last part from a file leaves the list, the plugin lets the
|
|
831
786
|
* player forget the file, which frees one of its 500 references.
|
|
@@ -835,17 +790,15 @@ export interface MediaSources {
|
|
|
835
790
|
* await plugin.media.sources.forget(token);
|
|
836
791
|
* ```
|
|
837
792
|
*
|
|
793
|
+
* @throws `disabled` (rejects) The plugin is stopping.
|
|
838
794
|
* @since 1.7.8
|
|
839
795
|
*/
|
|
840
796
|
forget(token: string): Promise<void>;
|
|
841
797
|
/**
|
|
842
798
|
* Every reference this plugin holds, each with its file looked at now.
|
|
843
799
|
*
|
|
844
|
-
* @capability media.sources
|
|
845
800
|
* @throws `busy` (rejects) This plugin has 4 source requests or checks
|
|
846
801
|
* running; try again when one has answered.
|
|
847
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
848
|
-
* `media.sources`.
|
|
849
802
|
*
|
|
850
803
|
* @example Forget the references the list no longer uses
|
|
851
804
|
* After the user cleared the list, the plugin forgets every file none of
|
|
@@ -865,16 +818,12 @@ export interface MediaSources {
|
|
|
865
818
|
* Open the remembered file in the player and play it from `start`
|
|
866
819
|
* seconds (default its beginning): the user's "preview this part". It
|
|
867
820
|
* is an ordinary open, as {@link Player.open} of that file would be (the
|
|
868
|
-
* current source is replaced; the playlist treats it as any open)
|
|
869
|
-
* needs `playback.control` as `Player.open` does, and `media.sources` for
|
|
870
|
-
* the token. The plugin names the file by its token instead of keeping
|
|
821
|
+
* current source is replaced; the playlist treats it as any open). The plugin names the file by its token instead of keeping
|
|
871
822
|
* its path; that is a convenience, not a boundary: once the file plays,
|
|
872
|
-
* `player.state.source`
|
|
823
|
+
* `player.state.source` shows its path, as for any
|
|
873
824
|
* open. Resolves once the file is loaded. A file that is gone or changed
|
|
874
825
|
* is refused before anything opens.
|
|
875
826
|
*
|
|
876
|
-
* @capability media.sources and playback.control (and playback.read, to
|
|
877
|
-
* follow the open until the file is loaded)
|
|
878
827
|
* @throws `source-missing` (rejects) No file is at the token's path any
|
|
879
828
|
* more; offer {@link MediaSources.locate}.
|
|
880
829
|
* @throws `source-changed` (rejects) The file changed since it was
|
|
@@ -885,8 +834,6 @@ export interface MediaSources {
|
|
|
885
834
|
* @throws `replaced` (rejects) Another source replaced it before it
|
|
886
835
|
* loaded.
|
|
887
836
|
* @throws `backend` (rejects) The player could not load the file.
|
|
888
|
-
* @throws `capability` (rejects) The manifest does not declare
|
|
889
|
-
* `media.sources` or `playback.control`.
|
|
890
837
|
*
|
|
891
838
|
* @example Preview a part on double-click
|
|
892
839
|
* Double-clicking a row of the plugin's list plays that part's file from
|