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.MediaPlayerControl
public boolean canSeekBackward()
canSeekBackward
in interface MediaController.MediaPlayerControl
public boolean canSeekForward()
canSeekForward
in interface MediaController.MediaPlayerControl
public 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.MediaPlayerControl
UnsupportedOperationException
- Always thrown.public int getBufferPercentage()
getBufferPercentage
in interface MediaController.MediaPlayerControl
public int getCurrentPosition()
getCurrentPosition
in interface MediaController.MediaPlayerControl
public int getDuration()
getDuration
in interface MediaController.MediaPlayerControl
public boolean isPlaying()
isPlaying
in interface MediaController.MediaPlayerControl
public void start()
start
in interface MediaController.MediaPlayerControl
public void pause()
pause
in interface MediaController.MediaPlayerControl
public void seekTo(int timeMillis)
seekTo
in interface MediaController.MediaPlayerControl