Don't affect pause status after playing in the background
This commit is contained in:
parent
d0de96da27
commit
d3bda4a204
@ -85,6 +85,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
private int resumeWindow;
|
private int resumeWindow;
|
||||||
private long resumePosition;
|
private long resumePosition;
|
||||||
private boolean loadVideoStarted;
|
private boolean loadVideoStarted;
|
||||||
|
private boolean isInBackground;
|
||||||
private boolean isPaused = true;
|
private boolean isPaused = true;
|
||||||
private boolean isBuffering;
|
private boolean isBuffering;
|
||||||
private float rate = 1f;
|
private float rate = 1f;
|
||||||
@ -174,11 +175,15 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHostResume() {
|
public void onHostResume() {
|
||||||
setPlayWhenReady(!isPaused);
|
if (!playInBackground || !isInBackground) {
|
||||||
|
setPlayWhenReady(!isPaused);
|
||||||
|
}
|
||||||
|
isInBackground = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHostPause() {
|
public void onHostPause() {
|
||||||
|
isInBackground = true;
|
||||||
if (playInBackground) {
|
if (playInBackground) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user