supervision-js
    Preparing search index...

    Interface MediaSession

    Public controller for one renderer-owned media item.

    interface MediaSession {
        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>;
        appendLiveDetectionFrame?(
            frame: DetectionFrame,
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        finalizeDetectionCoverage?(
            endTime?: number,
            options?: MediaSessionDetectionWriteOptions,
        ): Promise<ColdDetectionFrameStoreWriteSummary | null>;
        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;
    }

    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
    • Resize an engine-backed display-box source and await its presented output.

      Parameters

      Returns Promise<void>

    • 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>

    • Encodes the media frame the session is currently presenting.

      The session keeps decode and render ownership; hosts receive an encoded image of the raw media pixels plus the presentation timestamp of that exact frame. Defaults to JPEG.

      Parameters

      Returns Promise<MediaFrameCapture>

    • 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