[[VideoElementDisplay]] describes how a video element is displayed.

Constructors

Properties

boundingHeight: number

The height of the element on screen in CSS pixels, from getBoundingClientRect. 0 when the box is empty.

boundingWidth: number

The width of the element on screen in CSS pixels, from getBoundingClientRect, which includes CSS transforms. 0 when the box is empty.

contentHeight: number

The height of the element's content box in CSS pixels, from the ResizeObserver content rect. Undefined when the content box is empty.

contentWidth: number

The width of the element's content box in CSS pixels, from the ResizeObserver content rect, which ignores CSS transforms. Undefined when the content box is empty.

devicePixelRatio: () => number

The device pixel ratio now.

intersectionPercent: number

The percent of the element inside the viewport at the last intersection change. 0 when the element is not connected or its box is empty. It does not include visibility or opacity; see visiblePercent.

intrinsicLayout: boolean

Whether the element's content box equals the video's intrinsic size within 1 pixel, as when the element has no size of its own.

isRendered: () => boolean

Whether the element is rendered now, by checkVisibility with opacity and visibility.

The computed CSS object-fit of the element.

Methods

  • The on-screen height in device pixels, or undefined when the box is empty. The device pixel ratio is read on each call.

    Returns number

  • The on-screen width in device pixels, or undefined when the box is empty. The device pixel ratio is read on each call, because it changes without a resize, for example when the window moves to another display.

    Returns number

  • The percent of the element visible now: the intersection percent while checkVisibility passes, else 0. checkVisibility is read on each call, because opacity and visibility change without a resize or intersection change. It is a style check, not a layout read.

    Returns number