Shoji API Reference
    Preparing search index...

    Type Alias VideoProviderRenderer

    VideoProviderRenderer: (
        container: HTMLElement,
        item: GalleryItem,
        onReady: () => void,
        signal: AbortSignal,
        setPoster: (url: string) => void,
    ) => void

    DESIGN.md §4-video — supplies the embed for a non-'html5' provider. Build into container, call onReady() once it should show (sync or async — a spinner shows until then). signal fires 'abort' once this slide is no longer wanted; a returned cleanup can't work here since setup is often async and may resolve after eviction — release everything on abort instead, checking signal.aborted before acting on a stale slide.

    setPoster(url) — DESIGN.md §4.3 — shows url in place of the spinner while still waiting on onReady. Only meaningful when item.poster itself is unset: core already shows that immediately, before this renderer even runs, and silently ignores setPoster in that case (a host-supplied poster always wins). Meant for a provider-specific fallback a renderer can resolve on its own (e.g. a predictable thumbnail URL) when the host didn't supply one — entirely optional to call at all. A no-op once onReady has already fired or signal has aborted, so a slow-resolving fallback (an async fetch, say) can never replace an already-showing real embed, or paint over a slide that's moved on.

    Type Declaration

      • (
            container: HTMLElement,
            item: GalleryItem,
            onReady: () => void,
            signal: AbortSignal,
            setPoster: (url: string) => void,
        ): void
      • Parameters

        • container: HTMLElement
        • item: GalleryItem
        • onReady: () => void
        • signal: AbortSignal
        • setPoster: (url: string) => void

        Returns void