Skip to main content

Callbacks

Before starting​

Callbacks full list​

PropertyTypeDefaultDescription
setAPIResponsive Web logoWebTV logofunctionNA

It exposes DIVA APIs
(apiRef: DivaAPI) => void;
Video API reference

setPluginsManagerResponsive Web logofunctionNA

It exposes DIVA Plugins Manager APIs: register, remove and change the status of plugins
(pluginsManager: DivaPluginsManagerAPI) => void;
Plugins reference

onLogResponsive Web logofunctionNA

Logs callback
(log: logger.LogEntry) => void;

onVideoIdChangesResponsive Web logofunctionNA

Called when current videos change
(videoIds: string[]) => void;

onVideoMetadataChangesResponsive Web logoWebTV logofunctionNA

Called when videometadata of the main video changes
(videoMetadata: VideoMetadataClean) => void;

onAnalyticEventResponsive Web logoonAnalyticsWebTV logofunctionNA

Callback for generic analytic events
(event: GenericEvent) => void;

onMediaAnalyticEventResponsive Web logoonMediaAnalyticsWebTV logofunctionNA

Callback for media analytic events
(event: MediaEvent) => void;

onBackButtonClickResponsive Web logofunctionNA

Called when the user clicks on the back button during End of Play
(videoMetadata: VideoMetadataClean) => void;


Note: The implementation of this callback affects the presence of the button itself

onPlaybackRateResponsive Web logoWebTV logofunctionNA

Called when playback speed of the main video changes
(rate: number) => void;

onPlayerPositionResponsive Web logoWebTV logofunctionNA

Called when player position (both relative to the video logical start and unix timecode) of the main video changes

(position: { relativePosition: number; absolutePosition: Date } ) => void;

onPlayerMaxPositionResponsive Web logoWebTV logofunctionNA

Called when player max position (both relative to the video logical start and unix timecode) of the main video changes

(position: { relativePosition: number; absolutePosition: Date } ) => void;

onPlayerStateResponsive Web logoWebTV logofunctionNA

Called when player state of the main video changes
(state: PlayerState) => void;

onPreferredAudioTrackResponsive Web logoWebTV logofunctionNA

Called when the user select an audiotrack
(value: string) => void;

onPreferredCCTrackResponsive Web logoWebTV logofunctionNA

Called when the user select a closed caption
(value: string) => void;

onPreferredVideoQualityResponsive Web logoWebTV logofunctionNA

Called when the user select a video quality
(value: number | 'auto') => void;

onVideoErrorResponsive Web logoWebTV logofunctionNA

Called on DIVA errors

(videoError: VideoError, videoMetadata: VideoMetadataClean | undefined) => void;

onVideoEndResponsive Web logoWebTV logofunctionNA

Called when video end is reached
() => void;

onPlayerActionRequestResponsive Web logofunctionNA

Callback for actions called by API: play, pause, seek, seekBack, seekFroward, seekPercentage, seekAbsolute
(value: DivaAction) => void;

onPlaybackSessionResponsive Web logoWebTV logofunctionNA

Called on DIVA playback session changed.
It returns also a unique identifier of the DIVA item.

(value: { id: string; playbackSessionId: string }) => void;

onRelatedClickResponsive Web logoWebTV logofunctionNA

Called on user interaction to related item.
It returns a boolean. If false, it means that the default behaviour (switch) will be executed. On WebTV, the default behaviour is never executed.

(videoId: string;) => boolean;

onVolumeResponsive Web logofunctionNA

Called on user volume change.

(value: number;) => void;

onExitResponsive Web logofunctionNA

Called on user clicking on exit button.

(videoMetadata: VideoMetadataClean | undefined) => void;

onSharingResponsive Web logofunctionNA

Called on user clicking on share button.

(videoMetadata: VideoMetadataClean | undefined) => void;

onTtsMessageWebTV logofunctionNA

Callback for Text To Speech functionality

export type TtsArgs = Record<string, boolean | number | string>;
export interface TtsData {
messages: string[];
event: string;
args?: TtsArgs;
}

(data: TtsData) => void;