Shoji API Reference
    Preparing search index...

    Type Alias VideoDescriptor

    VideoDescriptor:
        | { provider: "html5" }
        | { provider: "youtube" | "vimeo"; id?: string; url?: string }
        | {
            provider: "custom";
            render: (
                el: HTMLElement,
                item: GalleryItem,
                onReady: () => void,
                signal: AbortSignal,
            ) => void;
        }

    'youtube'/'vimeo' are detected by core's DOM scanning too (§2.1) — cheap, dependency-free URL parsing, not the provider's SDK. Rendering any non-'html5' provider is a plugin's job (§4-video), via ctx.ui.registerVideoProvider() or 'custom''s own render.

    id is optional on the youtube/vimeo variant so dynamic-mode hosts can write video: { provider: 'youtube' } and let id be filled in from src (scan.ts's resolveDynamicVideoItems) — same reasoning as video: true above, just with the provider spelled out explicitly. A rendered item with no id (src wasn't a recognized URL either) shows a placeholder instead of a broken embed — see youtube.ts/vimeo.ts.

    Type Declaration

    • { provider: "html5" }
    • { provider: "youtube" | "vimeo"; id?: string; url?: string }
    • {
          provider: "custom";
          render: (
              el: HTMLElement,
              item: GalleryItem,
              onReady: () => void,
              signal: AbortSignal,
          ) => void;
      }
      • provider: "custom"
      • render: (
            el: HTMLElement,
            item: GalleryItem,
            onReady: () => void,
            signal: AbortSignal,
        ) => void

        Same contract as plugin.ts's VideoProviderRenderer — see its doc comment.