In ExoPlayer < 2.x there was a class PlayerControl with pause() and resume() functions but it was removed. I can't find a way to do this on ExoPlayer 2.
ExoPlayer < 2.x
PlayerControl
pause()
resume()
ExoPlayer 2
How can I pause and resume a playback?
You can use void setPlayWhenReady(boolean playWhenReady). If Exo is ready, passing false will pause the player. Passing true will resume it. You can check the player's state using getPlaybackState().
void setPlayWhenReady(boolean playWhenReady)
false
true
getPlaybackState()
2.1m questions
2.1m answers
60 comments
57.0k users