Play and pause a video
You can add TVSDK behavior to pause and play buttons.
- Create a pause/play button that does the following.
- Wait for your player to be in at least the PREPARED state.
- To start playback, call the TVSDK play method:
void play() throws IllegalStateException;
- To pause playback, call the TVSDK pause method:
void pause() throws IllegalStateException;
- Use the MediaPlayer.PlaybackEventListener.onStateChanged callback to check for errors or to take other appropriate actions.TVSDK calls this callback when the pause or play method is called. TVSDK passes information about the state change in the callback, including the new state, such as PAUSED or PLAYING.