In ExoPlayer < 2.x there was a class PlayerControl with pause() and resume() functions but it was removed. I can\'t fi
This is my way. Create two methods and call them when needed.
private void pausePlayer(){
player.setPlayWhenReady(false);
player.getPlaybackState();
}
private void startPlayer(){
player.setPlayWhenReady(true);
player.getPlaybackState();
}
call them here
@Override
protected void onPause() {
super.onPause();
pausePlayer();
}
@Override
protected void onResume() {
super.onResume();
startPlayer();
}