TVSDK dispatches playback events when media playback operations occur, such as a video starting to play.
To be notified about all playback-related events, register an implementation of MediaPlayer.PlaybackEventListener , including the following event callbacks.
|onPlayComplete||The end of a media source has been reached.|
|onPlayStart||Playback of a media source has started.|
|onRateSelected (float rate)||The user or TVSDK has selected a new playback rate, such as fast forward, rewind, or resume playing at a normal speed.|
|onRatePlaying (float rate)||A new playback rate is visible on the screen.|
|onPrepared||The media player has successfully prepared the media.|
|onSizeAvailable (long height, long width)||The size of the media is available.|
|onStateChanged ( MediaPlayer.PlayerState state, MediaPlayerNotification notification)||The state of the media player has changed. Your application should handle errors in this callback.|
|onProfileChanged (long profile, long time)||The media player's current profile has changed. Use the Profile property to get the new profile that is being played. Use the time property to get the time when this event occurred.|
|onUpdated||The media player has successfully updated the media in either of these cases:
|Manifest and Timeline|
|onTimedMetadata ( TimedMetadata timedMetadata)||A new timed metadata is discovered in the manifest.|
|onTimelineUpdated||The media player has added or removed ads, so it has an updated timeline.
The manifest refreshed for a live asset and old ad breaks were removed from the timeline or new ad opportunities (cue points) were discovered. The media player tries to resolve and place any new ads on the timeline.
Use this event to check whether the timeline has any updates (VOD does not change during playback). You can then retrieve the timeline using MediaPlayer.getTimeline .