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

    Interface Disposable

    Anything that owns player-side or local resources: every handle the API returns (commands, windows, panels, filters, snapshots, listeners…).

    A handle belongs to the Scope that created it and is disposed with that scope, so most plugins never call dispose() themselves. Call it to release one resource early. Disposing twice is harmless, and dispose() never rejects: failures are only written to the plugin log.

    What disposal does depends on the handle: a Command leaves the menu and the binding table, a Window closes, a Panel is unmounted, a VideoFilter / AudioFilter withdraws this plugin's chain, a Snapshot is released, an unfinished ExportJob is cancelled, a Stream stops, a Resolver is unregistered (aborting resolutions in flight), a JsonStore flushes, a running tools.run process is killed and a listener is unsubscribed. A Media is the exception: disposing its scope does not close the media; call Media.close for that.

    The listener reacts to the first time the source becomes ready and then stops being called. Every registration returns a Disposable; disposing it removes just that listener, before the scope that owns it ends.

    const subscription = plugin.player.on("source.ready", () => {
    void subscription.dispose(); // heard once
    });

    Every handle a plugin creates is a Disposable owned by the scope that created it; disposing the scope (or stopping the plugin) disposes them in reverse creation order, so a plugin rarely calls dispose itself.

    1.0.0

    interface Disposable {
        dispose(): Promise<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