@vestra-player/sdk 1.5.49 → 1.5.51
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 +21 -0
- package/README.md +1 -1
- package/bin/vestra-plugin.mjs +46 -0
- package/dist/commands.d.ts +6 -3
- package/dist/commands.js +14 -10
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +53 -0
- package/dist/docs.js +544 -0
- package/dist/i18n.js +3 -0
- package/dist/plugin/types.d.ts +12 -8
- package/llms.txt +31 -137
- package/package.json +6 -4
- package/llms-full.txt +0 -20347
package/llms.txt
CHANGED
|
@@ -1,148 +1,42 @@
|
|
|
1
1
|
# Vestra Player SDK
|
|
2
2
|
|
|
3
|
-
> @vestra-player/sdk 1.5.
|
|
3
|
+
> @vestra-player/sdk 1.5.51: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Read the documentation
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
- **Command line** (any coding agent): `npx -p @vestra-player/sdk vestra-plugin docs [path] [--page N]` prints one node of the tree; `npx -p @vestra-player/sdk vestra-plugin docs --search <words>` lists the matching paths. In a project that depends on the SDK, `npx vestra-plugin docs` is enough.
|
|
8
|
+
- **In a Node.js program**: `import { docs, searchDocs } from "@vestra-player/sdk/docs"`; `docs(path, { page })` and `searchDocs(query, { page })` return the same text.
|
|
9
|
+
- **Paths**: `/` lists the top level; every answer lists the paths one level down with a one-line summary. `/API/<category>/<symbol>/<member>` is one declaration with its signature, parameters, return value, errors, capability, player version and examples, for example `/API/Media/Snapshot/dispose`. `/Guides/<group>/<page>` is a page of the site, for example `/Guides/How-to/Test a plugin` (the file name works too: `/Guides/How-to/testing`). Case, spaces and punctuation do not matter, the leading `/` is optional, `.` works like `/`, a name alone finds its declaration (`TestHost`, `Snapshot.export`, `plugin.player`), and `#heading` opens the page of a long answer that has that section.
|
|
10
|
+
- **Size**: every answer is at most 8 KB; a longer one ends with the number of its next page (`--page 2`).
|
|
11
|
+
- **Before writing code**, read `/Guides/Tutorials/Getting started` and `/Guides/Guidelines`, then the API of what you use. Test with `/Guides/How-to/Test a plugin`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Top level
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
main.ts the entry module
|
|
19
|
-
ui/hello.slint optional: user interface
|
|
20
|
-
tests/main.test.ts tests (node:test)
|
|
21
|
-
package.json dev dependency and scripts
|
|
22
|
-
```
|
|
15
|
+
- `/Overview`: The package's README: what the SDK is, installing it and where to start.
|
|
16
|
+
- `/Guides`: The documentation pages, by group: tutorials, how-to guides, reference, explanation, guidelines, examples, upgrading.
|
|
17
|
+
- `/API`: Every type and value of @vestra-player/sdk (the plugin API), @vestra-player/sdk/testing (the test host) and @vestra-player/sdk/docs (this tree), by category.
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
## Guides
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Fields: `id`, `version`, `apiVersion`, `entry`, `capabilities`, `name`, `author`, `punchline`, `description`, `tags`, `icon`, `readme`, `changelog`, `sourceUrl`, `license`, `minPlayerVersion`; unknown fields and capabilities are rejected. Rules and limits: L2218–2292.
|
|
37
|
-
|
|
38
|
-
**main.ts**
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
import type { Plugin } from "@vestra-player/sdk";
|
|
42
|
-
|
|
43
|
-
export default async function activate(plugin: Plugin) {
|
|
44
|
-
plugin.commands.add({
|
|
45
|
-
id: "hello",
|
|
46
|
-
path: ["Tools", "Hello"],
|
|
47
|
-
run: () => plugin.osd.show("Hello"),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**Capabilities** (without one a call fails: `capability`)
|
|
53
|
-
|
|
54
|
-
- `producer.av`: Player.openStream (also `playback.control`)
|
|
55
|
-
- `playback.read`: Player.state/refresh/stats/chapters/audioDevices, Timeline.marks
|
|
56
|
-
- `playback.control`: Player.open/setPaused/seek/setRate/restart/close/scrub/setOutput/provideSequence/next/previous/addAudioTrack/selectAudioTrack/step/setStepSeek/setLoop/setAudioDevice, Power.preventSleep
|
|
57
|
-
- `source.resolve`: Resolvers.add
|
|
58
|
-
- `events`: Player/Subtitles/Timeline/MainWindow/Appearance/PanelSlot/Panel/BackdropSlot.onChange, Resolvers.onFileTypesChange
|
|
59
|
-
- `commands`: Commands.add, Host.run
|
|
60
|
-
- `ui.window`: Windows.create
|
|
61
|
-
- `ui.mount`: Panels.mount/bottom/sidebar/backdrop, PanelSlot/Panel/BackdropSlot.onChange
|
|
62
|
-
- `ui.dialog`: Dialogs.confirm/openFile/openFiles/openDirectory/saveFile
|
|
63
|
-
- `plugins.manage`: Packages.validate/validateArchive/setEnabled/reload/uninstall
|
|
64
|
-
- `processing.video`: Plugin.video.filter/video.view/video.render/video.shaders (also `playback.read`)
|
|
65
|
-
- `processing.audio`: Plugin.audio.filter (also `playback.read`, `events`)
|
|
66
|
-
- `subtitles.read`: Subtitles.state/onChange/refresh
|
|
67
|
-
- `subtitles.control`: Subtitles.select/load/remove/setStyle
|
|
68
|
-
- `media.read`: MediaCapture.capture, Snapshot.export (also `media.control`)
|
|
69
|
-
- `media.control`: MediaCapture.capture, Snapshot.export (also `media.read`)
|
|
70
|
-
- `ui.osd`: Osd.show/panel
|
|
71
|
-
- `clipboard`: Clipboard.readText/writeText/writeImage
|
|
72
|
-
- `window.control`: MainWindow.setVideoArea/setAlwaysOnTop/setCursorAutoHide/setPictureInPicture
|
|
73
|
-
- `bindings.manage`: Bindings.list/set/reset/onChange
|
|
74
|
-
- `timeline.marks`: Timeline.layer
|
|
75
|
-
- `ui.drop`: Drops.provide, Panel.onDrop
|
|
76
|
-
- `ui.settings`: Settings.page/show
|
|
77
|
-
- `ui.theme`: Appearance.set/setLanguage
|
|
78
|
-
- `secrets`: Secrets.get/set/delete
|
|
79
|
-
- `rendering.manage`: Rendering.setPreference/restartPlayer
|
|
80
|
-
- `video.upscaling`: VideoUpscaling.state/set/onChange
|
|
81
|
-
- No capability: `tools`, `storage`, `system`, `app`, `ui` (images and Markdown), `i18n`, reading window.state, appearance.theme, packages.list and rendering.state. Details: L2293–2353.
|
|
82
|
-
|
|
83
|
-
**Test**: `tests/*.test.ts` with `node:test`, run by `vestra-plugin test`. `startPlugin(activate, { directory: new URL("..", import.meta.url) })` from `@vestra-player/sdk/testing` returns `{ host, stop }`, `host` an in-memory player (TestHost): act (`host.command(id).run()`, `host.press(key)`), `await host.settle()`, assert on `host.osd`, `host.window(id).props`… Guide: L1861–2021; TestHost: L15530.
|
|
84
|
-
|
|
85
|
-
**Command line**
|
|
86
|
-
|
|
87
|
-
- `vestra-plugin check`: strict type check of the plugin's .ts files and tests/*.ts
|
|
88
|
-
- `vestra-plugin build`: check, then write dist/
|
|
89
|
-
- `vestra-plugin test`: node --test on tests/*.test.{ts,mjs}
|
|
90
|
-
- `vestra-plugin pack`: build, then dist/ → <out>/<id>-<version>.vxp
|
|
91
|
-
- `vestra-plugin i18n extract`: find the texts to translate, write locales/messages.pot and merge it into every locales/<lang>.po
|
|
92
|
-
- `vestra-plugin i18n check`: coverage per language, placeholder and plural problems, a stale messages.pot
|
|
93
|
-
- `vestra-player --plugin <dir>` runs a plugin from source, no build needed.
|
|
94
|
-
|
|
95
|
-
**Error codes** (`error.code`; branch on it, never on `message`)
|
|
96
|
-
|
|
97
|
-
- `stale`: A condition no longer held
|
|
98
|
-
- `capability`: The manifest does not declare the capability the call needs
|
|
99
|
-
- `invalid`: A bad argument
|
|
100
|
-
- `missing`: The target does not exist
|
|
101
|
-
- `busy`: The player is still doing a previous call of the same kind
|
|
102
|
-
- `conflict`: Another plugin owns the resource
|
|
103
|
-
- `unavailable`: Not possible right now
|
|
104
|
-
- `unsupported`: Not possible on this system, build or source
|
|
105
|
-
- `failed`: The operation ran and failed
|
|
106
|
-
- `aborted`: An `AbortSignal` fired
|
|
107
|
-
- `timeout`: A time limit ran out
|
|
108
|
-
- `limit`: A player-wide limit was reached, a property value is over the limits of PropValue
|
|
109
|
-
- `reserved`: The id is `vestra` or starts with `vestra.`
|
|
110
|
-
- `versionMismatch`: The package needs a newer player
|
|
111
|
-
- Others: PluginError, llms-full.txt L5972.
|
|
112
|
-
|
|
113
|
-
## Reference
|
|
114
|
-
|
|
115
|
-
- [llms-full.txt](https://vestrasys.github.io/vestra-player-sdk/llms-full.txt), also node_modules/@vestra-player/sdk/llms-full.txt; pages: [site](https://vestrasys.github.io/vestra-player-sdk/).
|
|
116
|
-
- Tutorials: Getting started L9–134; Add a window L135–213; Add settings and translations L214–367; Test, check, pack and publish L368–424; Write your own blur kernel L425–685
|
|
117
|
-
- How-to: Control playback L686–854; Store a plugin's data L855–961; Load subtitles from a plugin L962–1074; Keep a slider responsive while dragging L1075–1262; Remember a window's state between runs L1263–1414; Offer a GPU rendering switch L1415–1540; Keep a command's state without keeping the plugin running L1541–1697; Translate a plugin L1698–1860; Test a plugin L1861–2021; Publish a plugin L2022–2123; Troubleshooting L2124–2217
|
|
118
|
-
- Reference: Manifest L2218–2292; Capabilities L2293–2353; Limits L2354–2506; Commands, menus and bindings L2507–3033; Platforms L3034–3064; Theme L3065–3414; Command line L3415–3472; Error codes L3473–3520; Translations L3521–3613; Test host L3614–3800
|
|
119
|
-
- Explanation: How a plugin runs L3801–4007; Commands, menus and key bindings L4008–4162; Playback state, controls and sources L4163–4322; Video and audio processing L4323–4443; Windows, panels, settings pages, dialogs and the OSD L4444–4708; GPU and software rendering L4709–4725; The player's Rust core L4726–5067; How the player runs and talks to plugins L5068–5407
|
|
120
|
-
- Guidelines: Plugin rules L5408–5419; Interface guidelines L5420–5537; Menu guidelines L5538–5596
|
|
121
|
-
- Upgrading: Migrate a plugin to English source text L5597–5746; Migrating off package rollback (1.5.16, removed in 1.5.17) L5747–5824; Who must change, release by release L5825–5894
|
|
122
|
-
- [API: @vestra-player/sdk](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html): L5895–15203
|
|
123
|
-
- [API: @vestra-player/sdk/testing](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk_testing.html): L15204–18090
|
|
21
|
+
- `/Guides/Tutorials`: Step-by-step lessons; the first four build one plugin, from an empty folder to a tested package in the plugin store.
|
|
22
|
+
- `/Guides/How-to`: Short guides that each answer one practical question about writing, translating, testing or publishing a plugin.
|
|
23
|
+
- `/Guides/Reference`: Lookup tables that span many symbols (capabilities, manifest fields and player versions, limits, menu and binding names, platform differences, theme, command line), generated from the SDK's code.
|
|
24
|
+
- `/Guides/Explanation`: What each part of the player and its plugins is, why it works the way it does and how the parts fit together.
|
|
25
|
+
- `/Guides/Guidelines`: The rules a plugin follows so that its windows, panels, messages and menu items look and behave like the rest of Vestra Player.
|
|
26
|
+
- `/Guides/Examples`: Complete, tested example plugins with a screenshot each and a step-by-step walkthrough of their code.
|
|
27
|
+
- `/Guides/Upgrading`: What to change in a plugin when an SDK or player release deprecates, removes or changes something it uses.
|
|
124
28
|
|
|
125
29
|
## API
|
|
126
30
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
- bookmark: A tool window bound to the playback state: remember the position and jump back to it. L19228–19420
|
|
140
|
-
- panel-menu: A sidebar panel with its own right-click menu. L19421–19635
|
|
141
|
-
- menus: Radio menu items, separator groups and a menu item whose title changes. L19636–19801
|
|
142
|
-
- theme-widgets: A tool window drawn with the player's theme and widgets. L19802–19971
|
|
143
|
-
- markdown: A window that shows a Markdown document. L19972–20174
|
|
144
|
-
- i18n: A plugin in the player's language: English source text, a Chinese translation. L20175–20348
|
|
145
|
-
|
|
146
|
-
## Optional
|
|
147
|
-
|
|
148
|
-
- [Changelog](https://github.com/vestrasys/vestra-player-sdk/blob/main/CHANGELOG.md); full doc comments in the package's dist/plugin/*.d.ts; Slint library in slint/vestra/.
|
|
31
|
+
- `/API/Commands`: 15 entries: CommandState, Bindable, Condition, When, MenuId, BarButtonIcon, CommandButton, CommandOptions, Command, Commands, HostAction, Host, BindingRef, BindingInfo, Bindings
|
|
32
|
+
- `/API/Media`: 6 entries: CaptureOptions, Snapshot, ExportOptions, JobState, ExportJob, MediaCapture
|
|
33
|
+
- `/API/Packages`: 10 entries: PackageManifest, PackageSource, InstallOptions, PackageCandidate, PackageChangeStatus, PackageChange, PluginInfo, PluginDisplay, PluginWarning, Packages
|
|
34
|
+
- `/API/Playback`: 18 entries: MarkKind, TimelineMark, TimelineLayer, Timeline, AudioTrack, PlayerState, AudioDevice, Chapter, Conditional, Media, Scrub, StreamFrame, StreamOptions, StreamStartError, Stream,…
|
|
35
|
+
- `/API/Plugin`: 11 entries: Disposable, PluginError, Scope, Plugin, WindowState, MainWindow, AppInfo, App, SystemInfo, DisplayInfo, Json
|
|
36
|
+
- `/API/Processing`: 18 entries: FilterStatus, VideoFilter, AudioFilter, ViewSettings, VideoView, RenderSettings, RenderOptions, VideoShaders, UpscalingReasonCode, UpscalingReason, UpscalingDecodingCause,…
|
|
37
|
+
- `/API/Services`: 15 entries: Clipboard, Power, ToolResult, Tools, JsonStore, Storage, SessionStorage, System, Secrets, RenderingMode, RenderingPreference, RenderingReasonCode, RenderingReason, RenderingState,…
|
|
38
|
+
- `/API/Sources`: 7 entries: ResolverOptions, WebResolverOptions, FileResolverOptions, ResolvedStream, Resolver, Resolvers, ResolvedMedia
|
|
39
|
+
- `/API/Subtitles`: 5 entries: SubtitleTrack, SubtitlesState, SubtitleConditional, Subtitles, SubtitleStyle
|
|
40
|
+
- `/API/UI`: 42 entries: ImageRef, ImageOptions, MarkdownRef, MarkdownOptions, PropValue, PropData, Props, Ui, View, Window, Windows, SlotState, SlotPanel, PanelState, PanelSlot, SidebarSlot, Panel,…
|
|
41
|
+
- `/API/Testing`: 32 entries: CapabilityInfo, CAPABILITY_INFO, MESSAGE_LIMIT, COMMAND_LIMITS, MENU_IDS, BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS, BuiltinSubmenu, BUILTIN_SUBMENUS, BuiltinCommand, BUILTIN_COMMANDS, LOCALES,…
|
|
42
|
+
- `/API/Docs`: 4 entries: DOCS_PAGE_BYTES, DocsOptions, docs, searchDocs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vestra-player/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.51",
|
|
4
4
|
"description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -24,12 +24,15 @@
|
|
|
24
24
|
"types": "./dist/player-runtime.d.ts",
|
|
25
25
|
"default": "./dist/player-runtime.js"
|
|
26
26
|
},
|
|
27
|
+
"./docs": {
|
|
28
|
+
"types": "./dist/docs.d.ts",
|
|
29
|
+
"default": "./dist/docs.js"
|
|
30
|
+
},
|
|
27
31
|
"./ts-plugin": {
|
|
28
32
|
"types": "./ts-plugin/index.d.ts",
|
|
29
33
|
"default": "./ts-plugin/index.js"
|
|
30
34
|
},
|
|
31
35
|
"./llms.txt": "./llms.txt",
|
|
32
|
-
"./llms-full.txt": "./llms-full.txt",
|
|
33
36
|
"./package.json": "./package.json"
|
|
34
37
|
},
|
|
35
38
|
"bin": {
|
|
@@ -43,8 +46,7 @@
|
|
|
43
46
|
"README.md",
|
|
44
47
|
"CHANGELOG.md",
|
|
45
48
|
"LICENSE",
|
|
46
|
-
"llms.txt"
|
|
47
|
-
"llms-full.txt"
|
|
49
|
+
"llms.txt"
|
|
48
50
|
],
|
|
49
51
|
"scripts": {
|
|
50
52
|
"build": "node scripts/build.mjs",
|