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

    Interface App

    plugin.app: the fixed facts plus the system, read on request.

    The plugin builds a line such as "Vestra 0.5.10 on macOS 26.2" to copy into a bug report. app.version is known from the start; each system() call asks the player, which reads the displays at that moment. The operating system's name and version it works out once, at the first call, and reuses them.

    const system = await plugin.app.system();
    const text = `Vestra ${plugin.app.version} on ${system.name} ${system.version ?? ""}`;

    plugin.app holds facts fixed for the player's run (its version, build, library versions) and reads the system's on request: system() reads the displays at each call; the operating system's name and version are worked out once, at the first call, and reused.

    1.0.0

    interface App {
        version: string;
        build: string | null;
        components: {
            mpv: string | null;
            libav: Readonly<Record<string, string>>;
            slint: string;
        };
        temporary?: boolean;
        system(): Promise<SystemInfo>;
        openWindow(paths: readonly string[]): Promise<{ pid: number }>;
    }

    Hierarchy (View Summary)

    Index
    • The operating system, the displays and the renderer, read when called (displays come and go; the renderer can fall back from GPU to software once). CPU and memory: Node's os module.

      Returns Promise<SystemInfo>

      busy (rejects) The player could not start the request (no thread available).

      The plugin sizes its picture for the primary display. system() asks the player; displays lists the displays present now, the primary one first (empty without a user interface).

      const { displays } = await plugin.app.system();
      const primary = displays[0];
      if (primary) console.log(primary.width, primary.height);

      1.0.0

    • Open the files in a new temporary window: a second player with a temporary profile (AppInfo.temporary) that plays the first file and lists them all. Resolves once its process started, with its process id. Built-in plugins only.

      Parameters

      • paths: readonly string[]

        1 to 64 absolute paths of existing files, in play order.

      Returns Promise<{ pid: number }>

      The playlist's Play in New Window. The new window is a separate player process and keeps running after this one quits; it shares nothing with the calling plugin.

      builtin-only (rejects) The plugin is not built into the player.

      invalid (rejects) No path, more than 64, or a path that is not an absolute path.

      missing (rejects) A path that is not an existing file.

      unsupported (rejects) On macOS (not yet), or a player without windows.

      failed (rejects) The new player did not start.

      The playlist's row menu opens the selected local files in a temporary window, which plays them without changing the main window's list or settings.

      try {
      const { pid } = await plugin.app.openWindow(selected.slice(0, 64));
      console.log("temporary window", pid);
      } catch (error) {
      // `builtin-only`: not a built-in plugin; `unsupported`: macOS.
      if ((error as PluginError).code !== "builtin-only") throw error;
      }

      0.10.3

      1.10.1

    version: string

    The player's version, e.g. "0.7.1". This is the player's release version (the version of the published release), which can differ from the version of the host binary inside it. The player compares minPlayerVersion with this value, and plugins compare with it too.

    build: string | null

    Short git hash of the build, null when unknown.

    components: {
        mpv: string | null;
        libav: Readonly<Record<string, string>>;
        slint: string;
    }

    Versions of the player's main components.

    Type Declaration

    • Readonlympv: string | null

      libmpv's mpv-version.

    • Readonlylibav: Readonly<Record<string, string>>

      { ffmpeg: <ffmpeg-version> } (what libmpv reports).

    • Readonlyslint: string

      The linked Slint version, e.g. "1.18.1".

    temporary?: boolean

    true when this player is a temporary window (a guest, like a browser's guest window): a second player the main one started with App.openWindow (the playlist's Play in New Window), or one the user started with --guest. Absent in the main player and in a player before 0.10.3.

    A temporary window runs with a temporary profile that is deleted when it closes. Only the player's own settings (look, language, keys, rendering, window layout) are copied from the main window. A plugin's data directory (its options, history and lists included) and its session storage start empty and are discarded when the window closes; nothing a plugin writes reaches the main window. The plugin library and the keychain are the main window's, read-only: Secrets.get reads the main window's values, while Secrets.set, Secrets.delete, PackageCandidate.install, Packages.uninstall and Packages.setEnabled reject with unavailable. A plugin that does background work for the user's profile (an automatic update check, a sync) skips it here; work the user starts still runs.

    The main window checks for updates once a day; a temporary window leaves it to the main one. A check the user asks for still runs.

    if (!plugin.app.temporary) void checkForUpdates();
    

    0.10.3

    1.10.1