Interface VideoElementResolutionMonitor

[[VideoElementResolutionMonitor]] monitors a video element for resolution changes, first-frame rendering, and render metrics.

This interface has expanded beyond resolution and should eventually be renamed.

interface VideoElementResolutionMonitor {
    bindVideoElement(newElement: HTMLVideoElement): void;
    registerObserver(observer: VideoElementResolutionObserver): void;
    removeObserver(observer: VideoElementResolutionObserver): void;
}

Implemented by

Methods

  • Binds a new HTMLVideoElement for monitoring. If a video element is already bound, it is unbound and the new element is bound in its place. A null value just unbinds.

    Parameters

    • newElement: HTMLVideoElement

      The new HTMLVideoElement to be monitored, or null to unbind.

    Returns void

  • Registers an observer that will be notified when the resolution of the video element changes, or when the video element is unbound.

    Parameters

    • observer: VideoElementResolutionObserver

      An instance of VideoElementResolutionObserver that will receive update notifications.

    Returns void

  • Removes a previously registered observer, stopping it from receiving any further notifications.

    Parameters

    • observer: VideoElementResolutionObserver

      The observer to be removed from the notification queue.

    Returns void