Don't affect pause status after playing in the background

This commit is contained in:
Hampton Maxwell 2018-06-09 16:11:18 -07:00 committed by GitHub
parent d0de96da27
commit d3bda4a204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,6 +85,7 @@ class ReactExoplayerView extends FrameLayout implements
private int resumeWindow;
private long resumePosition;
private boolean loadVideoStarted;
private boolean isInBackground;
private boolean isPaused = true;
private boolean isBuffering;
private float rate = 1f;
@ -174,11 +175,15 @@ class ReactExoplayerView extends FrameLayout implements
@Override
public void onHostResume() {
if (!playInBackground || !isInBackground) {
setPlayWhenReady(!isPaused);
}
isInBackground = false;
}
@Override
public void onHostPause() {
isInBackground = true;
if (playInBackground) {
return;
}