@vestra-player/sdk - v1.11.3
    Preparing search index...

    Guides

    Each guide answers one practical question: "how do I do X?". A guide states its goal, gives the steps, often a complete example, and ends with where to read on. They assume you know the basics from the Tutorial.

    The rules every guide assumes, on one page: the plugin process and what it follows, handles and scopes, the update pass (set against bind, when a change shows), how values cross between TypeScript and Slint and which Slint types a plugin can write, commands, menus and keys, what keeps a plugin running and what is lost when it is stopped, the four places that change the picture and sound, the playback state, and how failures are reported.

    Read the guide

    A tool window is a Slint component the plugin creates from TypeScript. The guide opens one from a menu item, wires its controls to the plugin, stores its values, and brings back the values and whether it was open at the next start.

    Read the guide

    A settings page keeps its values in the plugin's storage. The player shows its interface in seven languages, chosen at start-up; a plugin writes every text in English (menu paths and titles, @tr("…") in its Slint files, templates such as osd.show("Speed {}×", [rate])) and ships one gettext file per language in locales/; the player translates, and the plugin contains no translation code. The guide adds a settings page, then covers the three places text lives, vestra-plugin i18n extract and check, and testing in another language.

    Read the guide

    Every control of plugin.player is conditional: it acts on the state the plugin last saw and fails with stale, doing nothing, when the user or another plugin changed the source meanwhile. The guide shows how to read the state and follow it while it shows, give menu items when conditions on state.can, handle stale and pass ifCurrent across slow work, open a file and follow it with its Media handle, use the player's own core actions for buttons, provide Next and Previous, and where sliders, loops and the output fit in.

    Read the guide

    A plugin has three places to keep data, all private to it: settings files (storage.json, across player restarts), session values (storage.session, across plugin restarts within one player run) and the system's secret store (secrets, for tokens). The guide says which to use for what, how each one writes and fails (debounced atomic files, the 1 MiB session limit, a missing or refused keychain), and where larger files go.

    Read the guide

    A slider reports every pointer move, often more than 60 times a second, so a slider that drives a video filter, the volume or a preview can lag or queue up requests. The guide builds a Brightness window and shows the four habits that keep it smooth: the callback records the newest value and never awaits; the expensive part is a call that keeps only the latest value (filter.set, player.setOutput, Scrub.seek); the slider's value is bound with bind, not set, so the plugin never fights the pointer; and one-off work waits for the release. It ends with a small helper that gives your own slow work latest-value behaviour, and with when to call plugin.update().

    Read the guide

    A subtitle plugin reads the tracks of the playing file, selects one (and handles stale when the user changed the selection meanwhile), uploads a file it found or converted (SRT or ASS, with the limits), and can set a style layer. The guide also explains which plugin's style the player shows when several set one.

    Read the guide

    The guide blurs the video with a kernel of your own, first as a GPU shader, then as a convolution node that also reaches snapshots, and finally with the ready-made gblur filter.

    Read the guide

    The player can draw the video on the GPU or in software, and keeps the user's choice itself, applied from the next start. The guide builds a settings item "GPU Rendering (Experimental)" from plugin.rendering.state(): checked when the next start uses the GPU, greyed out with the player's reason where the GPU cannot be chosen, "(Restart to Apply)" while a change waits, and a restart item that calls restartPlayer(). It also covers testing with TestHost.rendering.

    Read the guide

    A plugin learns the player's state in four ways: a read when a handler needs it, an event (a file opened, became ready, ended; the video, the audio tracks, the subtitles, the window, the layout or the audio devices changed), a trigger (a condition the player evaluates and wakes the plugin for: playing in fullscreen, a time, a position range) or a stream. Only the stream keeps the plugin running. The guide picks one for each need through four examples (on top while playing fullscreen, a sleep timer that survives an update, skipping ranges of the file, a window that shows the time left), shows the patterns for state that has no event, and tests them with the test host's clock and standby.

    Read the guide

    A menu item whose enabled or checked is a function is evaluated inside the plugin: the plugin must run, and what it reads of the player is only as new as the plugin's copy. A plugin.when condition is evaluated by the player itself, also while the plugin is stopped. The guide covers the when language (the source's phase and controls, pause, fullscreen, the theme and language, duration, volume, speed, tracks, the output device, the window), combining conditions with and, or, not, the plugin's own state as values, and a test that nothing keeps the plugin running.

    Read the guide

    @vestra-player/sdk/testing runs a plugin against TestHost, an in-memory player that speaks the real protocol. The guide shows the shape of a test (start, act, settle, assert, stop), how to act like the user (run commands, press keys and what press reports, fire window callbacks, answer dialogs), how to simulate sources and the main window, how to inject a refusal or a lost reply with host.handle, when settle() is enough and when to poll, and what to assert on.

    Read the guide

    Plugins reach the store through pull requests to the official plugin repository. The guide covers preparing the package, choosing the id, adding the plugin to the repository, the pull request and its checks, updating, withdrawing, asking for a revocation, and what users see of the plugin in the store.

    Read the guide

    A store is any https address that serves an index.json; users add it to the player's store under ⚙ ▸ Repositories…, and its plugins install and update from there, marked Unofficial and with a warning. The guide covers ids, the index format (packages with their size and sha256, icon, README and changelog, minPlayerVersion, revocations), what users see, testing on localhost, and a GitHub repository whose Actions pack every plugin with vestra-plugin pack and publish the index on GitHub Pages.

    Read the guide

    Claude Code, Cursor or the player's own Vestra Player AI read this documentation as a tree of short nodes, like go doc: npx -p @vestra-player/sdk vestra-plugin docs Snapshot.dispose prints one member's signature, errors, and examples, --search finds paths, and every answer stays under 8 KB. The guide shows what to put in the agent's instructions, the path scheme, searching, paging, and the same calls from a program with @vestra-player/sdk/docs.

    Read the guide

    The rules every plugin follows: only the public SDK, no other plugins' internals, both systems, its own id; how its windows, panels and on-screen messages use the theme and fit long or CJK text; where its commands go in the menus and which keys it may take.

    Read the rules

    Symptoms and their causes: interface pitfalls (callbacks bound too late, one-way bindings, state lost when a panel gets a new instance, hover effects that cost frames), values that do not appear after an await, stale and builtin-only failures, key bindings that do not fire, tests that fail only in CI, state lost at a restart.

    Read the page