public class PlayerControl extends Object implements MediaController.MediaPlayerControl
MediaController.MediaPlayerControl for controlling an ExoPlayer instance.
This class is provided for convenience, however it is expected that most applications will implement their own player controls and therefore not require this class.
| Constructor and Description |
|---|
PlayerControl(ExoPlayer exoPlayer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canPause() |
boolean |
canSeekBackward() |
boolean |
canSeekForward() |
int |
getAudioSessionId()
This is an unsupported operation.
|
int |
getBufferPercentage() |
int |
getCurrentPosition() |
int |
getDuration() |
boolean |
isPlaying() |
void |
pause() |
void |
seekTo(int timeMillis) |
void |
start() |
public PlayerControl(ExoPlayer exoPlayer)
public boolean canPause()
canPause in interface MediaController.MediaPlayerControlpublic boolean canSeekBackward()
canSeekBackward in interface MediaController.MediaPlayerControlpublic boolean canSeekForward()
canSeekForward in interface MediaController.MediaPlayerControlpublic int getAudioSessionId()
Application of audio effects is dependent on the audio renderer used. When using
MediaCodecAudioTrackRenderer, the recommended approach is
to extend the class and override
MediaCodecAudioTrackRenderer.onAudioSessionId(int).
getAudioSessionId in interface MediaController.MediaPlayerControlUnsupportedOperationException - Always thrown.public int getBufferPercentage()
getBufferPercentage in interface MediaController.MediaPlayerControlpublic int getCurrentPosition()
getCurrentPosition in interface MediaController.MediaPlayerControlpublic int getDuration()
getDuration in interface MediaController.MediaPlayerControlpublic boolean isPlaying()
isPlaying in interface MediaController.MediaPlayerControlpublic void start()
start in interface MediaController.MediaPlayerControlpublic void pause()
pause in interface MediaController.MediaPlayerControlpublic void seekTo(int timeMillis)
seekTo in interface MediaController.MediaPlayerControl