Version: 2.69.0

Visibility

THEOplayer > Visibility

Visibility interface

The visibility API.

Signature:
export interface Visibility

Properties

PropertyTypeDescription
rationumberThe ratio of pixels of the player that are within the viewport.
visiblebooleanWhether the Visibility.ratio of visible pixels is exceeded.
visibleThresholdnumberThe threshold that the ratio must exceed for the player to be visible.

Methods

MethodDescription
addObserver(step, callback)Add a visibility observer to monitor the player.
removeObserver(observer)Remove a visibility observer.The observer will stop monitoring player visibility, and will no longer trigger its callback.