Android OpenTV Player SDK  5.35.0.1710620932
IOTVUPIEventListener Interface Reference

Detailed Description

Interface definition of callbacks when events occur.

Inheritance diagram for IOTVUPIEventListener:
OTVUPIEventListener

Classes

class  NaturalSize
 Media size dimensions in onLoad events. More...
 
class  TrackInfo
 Track information for onTracksChanged events. More...
 

Public Member Functions

void onLoadStart (@NonNull String xSrc, @NonNull String xType)
 Gets called when the Media url starts to load. More...
 
void onLoad (int xDurationMs, int xTrickModeFlags, @NonNull NaturalSize xNaturalSize)
 Gets called when the Media url is loaded successfully. More...
 
void onTracksChanged (@NonNull List< TrackInfo > xTextTrackList, @NonNull List< TrackInfo > xAudioTrackList, @NonNull List< TrackInfo > xVideoTrackList)
 Gets called when the media content is loaded and tracks are found or updated from the content. More...
 
void onProgress (long xCurrentTimeMs, int xCurrentPositionMs, int xPlayableDurationMs, int xSeekableDurationMs)
 Gets called periodically to show the progress of playback. More...
 
void onStatisticsUpdate (OTVUPIStatistics xStatistics, int xEnabledStatistics)
 Gets called periodically to present statistics. More...
 
void onSeek (int xCurrentPositionMs, int xSeekPositionMs)
 Gets called when the seek completes. More...
 
void onEnd ()
 Gets called when the media reaches the end of playback. More...
 
void onWaiting ()
 Gets called when the player has not enough data to continue playback, but it may recover in a short time. More...
 
void onPlaying ()
 Gets called when the player has enough data for continuing playback, and recovered from onWaiting state. More...
 
void onPaused ()
 Gets called when the playback is paused. More...
 
void onPlay ()
 Gets called when the playback is playing. More...
 
void onStopped ()
 Gets called when the playback is stopped. More...
 
void onVideoTrackSelected (int xIndex)
 Gets called when the video track selection takes effect. More...
 
void onAudioTrackSelected (int xIndex)
 Gets called when the audio track selection takes effect. More...
 
void onTextTrackSelected (int xIndex)
 Gets called when the text track selection takes effect. More...
 
void onError (@NonNull OTVUPIError xError)
 Gets called on playback error. More...
 
void onBitratesAvailable (@Nullable int[] xBitrates)
 Gets called to provide details of content's available bitrates. More...
 
void onSelectedBitrateChanged (int xBitrate)
 Gets called on change in selected content's bitrate. More...
 
void onDownloadResolutionChanged (Pair< Integer, Integer > xResolution)
 Gets called on change in selected content's resolution. More...
 
void onThumbnailAvailable ()
 Indicates the stream being played contains preview thumbnails. More...
 
void onThumbnailNotAvailable ()
 Indicates the stream being played does not contain preview thumbnails. More...
 
void onOfflineStreamNotAvailable ()
 Indicates the offline stream is not available for playback The event onOfflineStreamNotAvailable will be triggered as soon as the player detects the offline stream does not exist. More...
 

Public Attributes

int ONLOAD_FLAG_CAN_PLAY_REVERSE = 0x01
 Flag for onLoad onLoad} Indicates whether the stream can play reverse. More...
 
int ONLOAD_FLAG_CAN_PLAY_FAST_FORWARD = 0x02
 Flag for onLoad onLoad} Indicates whether the stream can play forward. More...
 
int ONLOAD_FLAG_CAN_PLAY_SLOW_FORWARD = 0x04
 Flag for onLoad onLoad} Indicates whether the stream can play slow forward. More...
 
int ONLOAD_FLAG_CAN_PLAY_SLOW_REVERSE = 0x08
 Flag for onLoad onLoad} Indicates whether the stream can play slow reverse. More...
 
int ONLOAD_FLAG_CAN_STEP_BACKWARD = 0x10
 Flag for onLoad onLoad} Indicates whether the stream can step backward. More...
 
int ONLOAD_FLAG_CAN_STEP_FORWARD = 0x20
 Flag for onLoad onLoad} Indicates whether the stream can step forward. More...
 

Member Function Documentation

◆ onAudioTrackSelected()

void onAudioTrackSelected ( int  xIndex)

Gets called when the audio track selection takes effect.

Parameters
xIndexthe index of audio track in the audio tracks array.

Implemented in OTVUPIEventListener.

◆ onBitratesAvailable()

void onBitratesAvailable ( @Nullable int[]  xBitrates)

Gets called to provide details of content's available bitrates.

Parameters
xBitratesarray of bitrates (each bitrate in bits per second)

◆ onDownloadResolutionChanged()

void onDownloadResolutionChanged ( Pair< Integer, Integer >  xResolution)

Gets called on change in selected content's resolution.

Parameters
xResolutionresolution (width, height)

Implemented in OTVUPIEventListener.

◆ onEnd()

void onEnd ( )

Gets called when the media reaches the end of playback.

Implemented in OTVUPIEventListener.

◆ onError()

void onError ( @NonNull OTVUPIError  xError)

Gets called on playback error.

Parameters
xErrorOTVUPIError object

Implemented in OTVUPIEventListener.

◆ onLoad()

void onLoad ( int  xDurationMs,
int  xTrickModeFlags,
@NonNull NaturalSize  xNaturalSize 
)

Gets called when the Media url is loaded successfully.

Parameters
xDurationMsthe total duration of the media content in ms
xTrickModeFlagsa bitmapped integer indicating trick mode support
xNaturalSizeindicates the natural dimensions of the media data referenced by the track

Implemented in OTVUPIEventListener.

◆ onLoadStart()

void onLoadStart ( @NonNull String  xSrc,
@NonNull String  xType 
)

Gets called when the Media url starts to load.

Parameters
xSrcthe address of the media content
xTypeis the MIME-type of the media content

Implemented in OTVUPIEventListener.

◆ onOfflineStreamNotAvailable()

void onOfflineStreamNotAvailable ( )

Indicates the offline stream is not available for playback The event onOfflineStreamNotAvailable will be triggered as soon as the player detects the offline stream does not exist.

Implemented in OTVUPIEventListener.

◆ onPaused()

void onPaused ( )

Gets called when the playback is paused.

Implemented in OTVUPIEventListener.

◆ onPlay()

void onPlay ( )

Gets called when the playback is playing.

Implemented in OTVUPIEventListener.

◆ onPlaying()

void onPlaying ( )

Gets called when the player has enough data for continuing playback, and recovered from onWaiting state.

Implemented in OTVUPIEventListener.

◆ onProgress()

void onProgress ( long  xCurrentTimeMs,
int  xCurrentPositionMs,
int  xPlayableDurationMs,
int  xSeekableDurationMs 
)

Gets called periodically to show the progress of playback.

Default period is 250ms, but can be set in setProgressUpdateInterval.

Parameters
xCurrentTimeMsthe time from the content of the playback in ms
  • For VOD content this value is the current playback time between 0 and
    xSeekableDurationMs
  • For LIVE content this value is the program date time of the current playback
xCurrentPositionMsthe current position of the playback in ms
  • For VOD content this value equals to the
    xCurrentTimeMs
  • For LIVE content this value is the elative position of the seekable windows start, and it is a value between 0 and the
    xSeekableDurationMs
xPlayableDurationMsthe duration of the currently buffered media data in ms
xSeekableDurationMsthe seekable duration of the media data in ms
  • For VOD content, the value equals to the
    xDurationMs
    from onLoad
  • For LIVE content this value is equal to the seekable window size in ms

Implemented in OTVUPIEventListener.

◆ onSeek()

void onSeek ( int  xCurrentPositionMs,
int  xSeekPositionMs 
)

Gets called when the seek completes.

Parameters
xCurrentPositionMsthe current position after seek completes in ms
xSeekPositionMsthe requested position in ms

Implemented in OTVUPIEventListener.

◆ onSelectedBitrateChanged()

void onSelectedBitrateChanged ( int  xBitrate)

Gets called on change in selected content's bitrate.

Parameters
xBitratebitrate (in bits per second)

Implemented in OTVUPIEventListener.

◆ onStatisticsUpdate()

void onStatisticsUpdate ( OTVUPIStatistics  xStatistics,
int  xEnabledStatistics 
)

Gets called periodically to present statistics.

Default period is 5000ms, but can be set in IOTVUPIPlayer#setStatisticsConfig(OTVUPIStatisticsConfig).

Parameters
xStatisticsthe structure containing all statistics
xEnabledStatisticsA bitmap representing which statistics are to be sent

Implemented in OTVUPIEventListener.

◆ onStopped()

void onStopped ( )

Gets called when the playback is stopped.

Implemented in OTVUPIEventListener.

◆ onTextTrackSelected()

void onTextTrackSelected ( int  xIndex)

Gets called when the text track selection takes effect.

Parameters
xIndexthe index of text track in the text tracks array.

Implemented in OTVUPIEventListener.

◆ onThumbnailAvailable()

void onThumbnailAvailable ( )

Indicates the stream being played contains preview thumbnails.

The event onThumbnailAvailable will be triggered as soon as the player detects any existing compatible thumbnails in the source requested to be played. This is triggered only once for a new content request. This is required for the App to decide setting up of displayThumbnail

Implemented in OTVUPIEventListener.

◆ onThumbnailNotAvailable()

void onThumbnailNotAvailable ( )

Indicates the stream being played does not contain preview thumbnails.

The event onThumbnailNotAvailable will be triggered as soon as the player detects no any existing compatible thumbnails in the source requested to be played. This is triggered only once for a new content request.

Implemented in OTVUPIEventListener.

◆ onTracksChanged()

void onTracksChanged ( @NonNull List< TrackInfo xTextTrackList,
@NonNull List< TrackInfo xAudioTrackList,
@NonNull List< TrackInfo xVideoTrackList 
)

Gets called when the media content is loaded and tracks are found or updated from the content.

Parameters
xTextTrackListthe list of text tracks (subtitles)
xAudioTrackListthe list of audio tracks
xVideoTrackListhe list of video tracks

Implemented in OTVUPIEventListener.

◆ onVideoTrackSelected()

void onVideoTrackSelected ( int  xIndex)

Gets called when the video track selection takes effect.

Parameters
xIndexthe index of video track in the video tracks array.

Implemented in OTVUPIEventListener.

◆ onWaiting()

void onWaiting ( )

Gets called when the player has not enough data to continue playback, but it may recover in a short time.

Implemented in OTVUPIEventListener.

Member Data Documentation

◆ ONLOAD_FLAG_CAN_PLAY_FAST_FORWARD

int ONLOAD_FLAG_CAN_PLAY_FAST_FORWARD = 0x02

Flag for onLoad onLoad} Indicates whether the stream can play forward.

◆ ONLOAD_FLAG_CAN_PLAY_REVERSE

int ONLOAD_FLAG_CAN_PLAY_REVERSE = 0x01

Flag for onLoad onLoad} Indicates whether the stream can play reverse.

◆ ONLOAD_FLAG_CAN_PLAY_SLOW_FORWARD

int ONLOAD_FLAG_CAN_PLAY_SLOW_FORWARD = 0x04

Flag for onLoad onLoad} Indicates whether the stream can play slow forward.

◆ ONLOAD_FLAG_CAN_PLAY_SLOW_REVERSE

int ONLOAD_FLAG_CAN_PLAY_SLOW_REVERSE = 0x08

Flag for onLoad onLoad} Indicates whether the stream can play slow reverse.

◆ ONLOAD_FLAG_CAN_STEP_BACKWARD

int ONLOAD_FLAG_CAN_STEP_BACKWARD = 0x10

Flag for onLoad onLoad} Indicates whether the stream can step backward.

◆ ONLOAD_FLAG_CAN_STEP_FORWARD

int ONLOAD_FLAG_CAN_STEP_FORWARD = 0x20

Flag for onLoad onLoad} Indicates whether the stream can step forward.