Version: 2.67.0

Visibility

THEOplayer > Visibility

Visibility interface

The visibility API.

Signature:
export interface Visibility

Properties

Property

Type

Description

ratio

number

The ratio of pixels of the player that are within the viewport.

visible

boolean

Whether the Visibility.ratio of visible pixels is exceeded.

visibleThreshold

number

The threshold that the ratio must exceed for the player to be visible.

Methods

Method

Description

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.