supervision-js
    Preparing search index...

    Interface LiveMediaSession

    Media session that also exposes live detection ingestion.

    createMediaSession returns this shape. The members it requires are optional on MediaSession, so live ingestion is an added capability rather than a required one.

    interface LiveMediaSession {
        frameClock?: MediaFrameClock | null;
        frameNavigation?: MediaFrameNavigation | null;
        setDisplay?(display: MediaRendererDisplay): Promise<void>;
        detectionSource?: DetectionFrameSource | WritableDetectionFrameSource;
        media: MediaSessionMediaState;
        renderer: MediaRenderer;
        appendDetectionFrames(
            frames: readonly DetectionFrame[],
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        replaceDetectionFrames(
            frames: readonly DetectionFrame[],
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        clearDetectionFrames(
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<void>;
        getDetectionSummary(
            options?: MediaSessionDetectionWriteOptions,
        ): ColdDetectionFrameStoreWriteSummary | null;
        play(): Promise<void>;
        pause(): void;
        seek(mediaTime: number): Promise<void>;
        stepForward(): Promise<void>;
        stepBackward(): Promise<void>;
        setPlaybackRate(playbackRate: number): void;
        refresh(): Promise<void>;
        captureFrame(
            options?: MediaFrameCaptureOptions,
        ): Promise<MediaFrameCapture>;
        setPresentation(presentation: MediaRendererPresentation): void;
        setDepth?(depth: MediaRendererDepthInput | null): Promise<void>;
        setRenderQuality(quality: MediaRendererQuality): void;
        subscribe(
            listener: MediaSessionStateListener,
        ): MediaSessionStateUnsubscribe;
        getState(): MediaSessionState;
        destroy(): void;
        appendLiveDetectionFrame(
            frame: DetectionFrame,
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        finalizeDetectionCoverage(
            endTime?: number,
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<ColdDetectionFrameStoreWriteSummary | null>;
    }

    Hierarchy (View Summary)

    Index
    frameClock?: MediaFrameClock | null

    Exact frame timing when the media source provides an index; null otherwise.

    frameNavigation?: MediaFrameNavigation | null

    Indexed moves and observable scrub landings for push-based indexed sources.

    Detection source used by the renderer. Present when the session was created with static frames, a source, or an appendable source.

    renderer: MediaRenderer
    • Returns Promise<void>

    • Returns void

    • Parameters

      • mediaTime: number

      Returns Promise<void>

    • Returns Promise<void>

    • Returns Promise<void>

    • Parameters

      • playbackRate: number

      Returns void

    • Re-read semantic detections and redraw the current presentation.

      Returns Promise<void>

    • Replaces the session's depth, or removes it with null, and redraws the frame on screen. Resolves once the renderer has that depth, and rejects with the reason a manifest did not load; the media keeps playing meanwhile. session.renderer.getActiveDepth() reads back what is drawn.

      Parameters

      Returns Promise<void>

    • Returns void