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 logoWebTV logofunctionNA

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

onLogfunctionNA

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

onVideoIdChangesfunctionNA

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

onVideoMetadataChangesfunctionNA

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

onAnalyticEventfunctionNA

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

onMediaAnalyticEventfunctionNA

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

onBackButtonClickfunctionNA

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

onPlaybackRatefunctionNA

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

onPlayerPositionfunctionNA

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;

onPlayerMaxPositionfunctionNA

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;

onPlayerStatefunctionNA

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

onPreferredAudioTrackfunctionNA

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

onPreferredCCTrackfunctionNA

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

onPreferredVideoQualityfunctionNA

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

onVideoErrorfunctionNA

Called on DIVA errors

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

onVideoEndfunctionNA

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

onPlayerActionRequestfunctionNA

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

onPlaybackSessionfunctionNA

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

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