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

    Interface Drops

    plugin.drops: files dropped on the video area. Needs ui.drop.

    Files dropped on the video area go to providers by extension: each extension belongs to the provider registered for it first, and each provider gets one call with all of its paths. Files nobody takes are ignored. A panel with Panel.onDrop takes drops on itself first.

    .ch8 files dropped on the player are added to the plugin's list. The provider claims the extension; the player calls drop with the dropped paths of that type, in the order the file manager gave them. Extensions go to the first provider: the built-in playlist claims every audio and video extension when it starts, and a built-in plugin cannot be disabled, so another plugin's provider for those never gets them (except a development load that replaces the playlist under its id).

    const queue: string[] = [];
    plugin.drops.provide({
    extensions: ["ch8"],
    drop: ({ paths }) => {
    queue.push(...paths); // only .ch8 files reach here
    },
    });

    1.0.0

    interface Drops {
        provide(handler: DropHandler): Disposable;
    }
    Index
    • Take files dropped on the video area. The first provider registered for an extension gets it; files nobody takes are ignored.

      Paths are grouped by provider (an extension, case-insensitive, belongs to the provider that registered it first) in the order the file manager gave them, one call per provider. Folders are not expanded.

      Parameters

      Returns Disposable

      invalid synchronously for malformed extensions.

      Dropping .srt or .ass files on the video loads each one as a subtitle track. Each extension belongs to the provider that registered it first; the player groups the dropped paths by provider and calls each provider once with all of its paths, so .srt and .ass files dropped together arrive in one call. (A panel under the pointer that listens with onDrop takes the whole drop first.) The plugin reads each file itself and uploads its bytes with subtitles.load.

      plugin.drops.provide({
      extensions: ["srt", "ass"],
      drop: async ({ paths }) => {
      // Only .srt and .ass files reach this provider.
      for (const path of paths)
      await plugin.subtitles.load(await readFile(path), {
      format: path.endsWith(".ass") ? "ass" : "srt",
      });
      },
      });

      1.0.0