supervision-js
    Preparing search index...

    Interface MediaSessionOptions

    Options for creating one renderer-owned media session.

    interface MediaSessionOptions {
        container: HTMLElement;
        media: MediaSessionMedia;
        mode?: MediaSessionMode;
        normalize?: false | MediaSessionNormalizationOptions;
        detections?: MediaSessionDetectionOptions;
        depth?: MediaRendererDepthInput;
        playbackGate?: boolean;
        onState?: (state: MediaSessionState) => void;
        presentation?: MediaRendererPresentation;
        renderer?: MediaSessionRendererOptions;
    }
    Index
    container: HTMLElement

    DOM element where the renderer should mount its canvas.

    Media to prepare and render. This can be a URL, an uploaded file/blob, or a lower-level renderer source.

    File mode is bounded media. Stream mode tunes defaults for live or append-only detection sources.

    Optional browser media normalization before rendering.

    Detection frames or sources to render with the media.

    Depth drawn by depth annotation renderers, beside detections. See MediaRendererDepthInput for what a map or a clip manifest needs.

    The session does not wait for a manifest: the media shows and plays as soon as it can, and depth joins it when its files arrive. A manifest that fails to load leaves the media playing without depth, with a console warning and the reason in renderPreparation.message. To wait for depth or catch its error, call setDepth().

    playbackGate?: boolean

    Buffered playback: hold the picture until the frame it is about to show has both its detections and its prepared annotation artifacts. Opening still presents an initial media frame so the session can accept future appends; these gates hold subsequent playback, not session creation.

    On by default. false starts playback at once and draws annotations as they land, which suits a host that cares about cadence more than overlays. The switch answers for detections.playbackGate and renderer.renderPreparation.playbackGate together, each keeping its own lookahead; set either one's enabled to answer for that gate alone.

    The detection gate only applies to a session with appendable detections, since a source that is complete before playback starts has nothing to wait for. true turns it on for any session.

    Both kinds of source are held frame by frame for as long as playback runs. A source the renderer pulls decoded samples from waits between decoding and drawing. A source that presents its own frames, which is what createWebVideoEngineMediaRendererSource returns, is stopped when detection coverage or prepared artifacts are missing and started again when the wait settles.

    onState?: (state: MediaSessionState) => void

    Aggregate loading, playback, buffering, processing, and error state.

    Box, mask, label, interaction, and focus presentation styles.

    Renderer playback, interaction, diagnostics, and render-preparation options.