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

    Interface OsdPanel

    This plugin's information block on the OSD: multi-line text over the video that stays until the plugin changes or removes it. Made by Osd.panel.

    The block sits under the OSD message line, on a translucent dark plate (see Osd for sizes), and takes no input. When several plugins have one, they are stacked from top to bottom. dispose(), disposing the scope or stopping the plugin removes it.

    A block over the video shows the position and the duration, updated as playback moves, while the user has it switched on. A stream's listener runs after the SDK updated the state; set never throws and sends only the newest text while one is in flight, so calling it on every change is fine. The stream lives only while the block shows, so the plugin can be stopped while it is off.

    const shown = plugin.scope(); // the block and its stream, together
    const info = shown.osd.panel();
    shown.player.stream((state) =>
    // A template with data arguments; the player translates "{} / {} s".
    info.set("{} / {} s", [state.position?.toFixed(1) ?? "–", state.duration?.toFixed(1) ?? "–"]),
    );
    // Switched off: removes the block and stops the stream.
    await shown.dispose();

    1.0.0

    interface OsdPanel {
        dispose(): Promise<void>;
        set(
            text: TextValue | null,
            args?: TemplateArgs | null,
            options?: OsdPanelOptions,
        ): void;
    }

    Hierarchy (View Summary)

    Index
    • Release the resource. Resolves once the player confirmed the release (or immediately for purely local resources). Never rejects.

      Returns Promise<void>

      Never.

      A "Turn feature off" item removes the feature's own menu item at once, before the plugin stops. dispose takes the command out of the menu and the binding table and resolves once the player confirmed it; the id can be added again later.

      const extra = plugin.commands.add({ id: "extra", path: ["Tools", "Extra"], run() {} });
      plugin.commands.add({
      id: "extra-off",
      path: ["Tools", "Turn extra off"],
      run: () => extra.dispose(), // never rejects
      });

      1.0.0

    • Show the block with this text, change it, or hide it.

      Parameters

      • text: TextValue | null

        The text, with \n between lines: at most 32 lines and 4096 bytes once translated and formatted. null hides the block. A template, like Osd.show's.

      • Optionalargs: TemplateArgs | null

        Values for its placeholders; null or omitted for none.

      • Optionaloptions: OsdPanelOptions

        maxColumns: cut long lines.

      Returns void

      Latest value wins: calling it on every state change is fine, the same text is not sent twice and only the newest text is sent while a write is in flight. Never throws; a failed write goes to Scope.onError (invalid for too much text, unavailable without a user interface).

      The block shows "A: 12.0 s" and "B: 18.5 s" on two lines, then disappears. The text is a template the player translates and fills in; \n separates lines, and null hides the block.

      const info = plugin.osd.panel();
      info.set("A: {} s\nB: {} s", ["12.0", "18.5"]);
      info.set(null); // hide it

      1.0.0