Show Menu
TOPICS×

Playback events

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.
Event Meaning
Playback
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.
Media
onPrepared The media player has successfully prepared the media.
onSizeAvailable (long height, long width) The size of the media is available.
Media Player
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.
MediaplayerItem
onUpdated The media player has successfully updated the media in either of these cases:
  • When a manifest refresh occurs for a live asset.
  • When a VOD or live asset has closed captioning and activity is first discovered for a closed captioning track.
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 .