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

    Interface System

    plugin.system: files and links, executed by the player. Other systems than macOS and Windows: unsupported.

    The file manager opens with the exported file selected, then the browser opens the plugin's help page. The player performs both on the plugin's behalf; they reject with unsupported on systems other than macOS and Windows, which the plugin turns into a message.

    try {
    await plugin.system.reveal(exportedFile);
    await plugin.system.openUrl("https://example.com/help");
    } catch (error) {
    if ((error as PluginError).code !== "unsupported") throw error;
    await plugin.osd.show(`Saved to ${exportedFile}`); // no file manager to open
    }

    The player opens files, folders and links with the system's own applications for the plugin, so the plugin never runs open, explorer or a shell itself.

    1.0.0

    interface System {
        reveal(paths: string | string[]): Promise<void>;
        openPath(path: string): Promise<void>;
        openUrl(url: string): Promise<void>;
    }
    Index
    • Select files or folders in the file manager (macOS: one Finder window for all, so several files of one folder are all highlighted; Windows: one Explorer window per folder, selecting its first path). Paths that do not exist are skipped; missing when none exists; at most 256.

      Parameters

      • paths: string | string[]

      Returns Promise<void>

      missing (rejects) None of the paths exists.

      invalid (rejects) No paths, or more than 256.

      failed (rejects) The system refused.

      timeout (rejects) macOS did not answer within 10 s.

      unsupported (rejects) A system other than macOS and Windows.

      After an export, the file manager opens with the new files selected. Paths that no longer exist are skipped; the call rejects with missing only when none of them exists.

      await plugin.system.reveal(exported); // macOS: one Finder window for all
      

      1.0.0

    • Open the file or folder with its default application. missing if absent.

      Parameters

      • path: string

      Returns Promise<void>

      missing (rejects) The path does not exist.

      invalid (rejects) An empty path.

      failed (rejects) The system refused.

      timeout (rejects) macOS did not answer within 10 s.

      unsupported (rejects) A system other than macOS and Windows.

      A "Show data folder" command opens the plugin's data directory in the file manager, which is the default application for a folder.

      await plugin.system.openPath(plugin.dataDirectory);
      

      1.0.0

    • Open an http(s) address in the default browser. invalid for another protocol or a malformed address; timeout after 10 s, failed otherwise.

      Parameters

      • url: string

      Returns Promise<void>

      invalid (rejects) Not an http: or https: address.

      timeout (rejects) macOS did not hand it to the browser within 10 s.

      failed (rejects) The system refused.

      unsupported (rejects) A system other than macOS and Windows.

      A Help command opens the plugin's documentation in the default browser. Only http: and https: addresses are opened.

      await plugin.system.openUrl("https://example.com/plugin/help");
      

      1.0.0