supervision-js
    Preparing search index...

    Interface MediaRenderer

    Lower-level renderer controller.

    Prefer MediaSession for application code unless you need to own media preparation and detection buffering yourself.

    interface MediaRenderer {
        frameClock?: MediaFrameClock | null;
        frameNavigation?: MediaFrameNavigation | null;
        setDisplay?(display: MediaRendererDisplay): Promise<void>;
        play(): Promise<void>;
        pause(): void;
        togglePlayback(): Promise<void>;
        seek(mediaTime: number): Promise<void>;
        scrub(mediaTime: number): void;
        stepForward(): Promise<void>;
        stepBackward(): Promise<void>;
        setPlaybackRate(playbackRate: number): void;
        refresh(): Promise<void>;
        captureFrame(
            options?: MediaFrameCaptureOptions,
        ): Promise<MediaFrameCapture>;
        setSelectedDetection(
            selection: DetectionSelectionOptions | null,
        ): DetectionPickResult | null;
        setDepth?(depth: MediaRendererDepthInput | null): Promise<void>;
        getActiveDepth?(): ActiveDepthMap | null;
        getRenderCount(): number | null;
        getPreparedAnnotationWindow(): PreparedAnnotationWindowSnapshot | null;
        destroy(): void;
        getViewportTransform(): ViewportTransform;
        setViewportTransform(
            transform: Partial<Omit<ViewportTransform, "locked">>,
        ): void;
        setViewportLocked(locked: boolean): void;
        screenToMedia(point: Point): Point;
        mediaToScreen(point: Point): Point;
        getDetectionLabelBounds(
            detectionId: string | number,
        ): DetectionLabelBounds | null;
        panViewportBy(dx: number, dy: number): void;
        zoomViewportAt(point: Point, factor: number): void;
        zoomViewportFromWheel(point: Point, deltaY: number): void;
        setPresentation(presentation: MediaRendererPresentation): void;
        setRenderQuality(quality: MediaRendererQuality): void;
        setDisplayAdjustments?(adjustments: MediaDisplayAdjustments): void;
        getActiveDetectionFrame(): DetectionFrame | null;
        getState(): MediaRendererState;
    }

    Hierarchy

    • MediaRendererStateController
      • MediaRenderer
    Index
    frameClock?: MediaFrameClock | null

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

    frameNavigation?: MediaFrameNavigation | null

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

    • Resize engine-backed display-box output without reopening the source. Resolves after the resized frame is presented; supersession rejects with AbortError. Available only on sources that support live output sizing.

      Parameters

      Returns Promise<void>

    • Returns Promise<void>

    • Returns void

    • Flips playback without the caller first reading which way it is going, so a frame presented between the read and the call cannot invert the result. Rejects when the play it decides on fails.

      Returns Promise<void>

    • Lands on mediaTime and resolves once the frame there is presented.

      Parameters

      • mediaTime: number

      Returns Promise<void>

    • Moves the playhead for a gesture that is still moving, such as a timeline drag between pointer down and up. The frame that answers it may be an approximation; seek is what lands the released position exactly.

      Parameters

      • mediaTime: number

      Returns void

    • Returns Promise<void>

    • Returns Promise<void>

    • Parameters

      • playbackRate: number

      Returns void

    • Re-read detections and redraw the currently presented media frame.

      Returns Promise<void>

    • Encodes the media frame that is currently presented.

      The renderer keeps decode and render ownership: the returned image is a copy of the presented media pixels taken before encoding starts, so a frame presented while the encoder runs cannot change the result.

      Parameters

      Returns Promise<MediaFrameCapture>

    • Replaces the depth that depth renderers draw, or removes it with null, and redraws the frame on screen. Rejects with a RangeError for a malformed map or one whose aspect ratio differs from the media's.

      Parameters

      Returns Promise<void>

    • The depth map on screen, with the media size it is stretched over, or null when no depth is drawn. Pass it to readDepthAt for a readout.

      Returns ActiveDepthMap | null

    • Explicit renders issued under the render-on-change policy, which a media source that pushes presented frames and a still image run under: the count moves when something on screen changed, so a paused, untouched renderer holds it still. It is null when the renderer pulls samples from media that plays, because Pixi's ticker then paints every animation frame and no count describes that, so a null here is an answer rather than a failure.

      Returns number | null

    • Span and per-frame readiness of the prepared annotation window, for instruments; null when the scene free-runs on the ticker or no window exists, so a null here is an answer rather than a failure.

      Returns PreparedAnnotationWindowSnapshot | null

    • Returns void

    • Returns ViewportTransform

    • Apply an exact natural-media-to-CSS transform, including while locked. The scale must be positive and finite. Locking suppresses pointer viewport gestures; it does not block explicit toolbar or restored viewport state.

      Parameters

      Returns void

    • Prevent pointer viewport gestures without blocking explicit transforms.

      Parameters

      • locked: boolean

      Returns void

    • Convert container-relative CSS pixels to natural media pixels.

      Parameters

      Returns Point

    • Convert natural media pixels to container-relative CSS pixels.

      Parameters

      Returns Point

    • Returns the label rectangle exactly as laid out by the renderer.

      Coordinates are relative to the renderer container and already include fit, pan, zoom, screen-stable label sizing, and media-edge clamping.

      Parameters

      • detectionId: string | number

      Returns DetectionLabelBounds | null

    • Parameters

      • dx: number
      • dy: number

      Returns void

    • Parameters

      • point: Point
      • factor: number

      Returns void

    • Parameters

      • point: Point
      • deltaY: number

      Returns void

    • Parameters

      Returns void

    • Parameters

      Returns void

    • Returns DetectionFrame | null