Added flag for background mode (#563)

* Added flag for background mode

* Better flag name
This commit is contained in:
Nawal "Deshi" Rahim 2017-05-09 06:30:45 +10:00 committed by Matt Apperson
parent 98c51f114b
commit 72a46bc308

View File

@ -93,6 +93,7 @@ class ReactExoplayerView extends FrameLayout implements
private boolean repeat;
private boolean disableFocus;
private float mProgressUpdateInterval = 250.0f;
private boolean playInBackground = false;
// \ End props
// React
@ -171,11 +172,17 @@ class ReactExoplayerView extends FrameLayout implements
@Override
public void onHostResume() {
if (playInBackground) {
return;
}
setPlayWhenReady(!isPaused);
}
@Override
public void onHostPause() {
if (playInBackground) {
return;
}
setPlayWhenReady(false);
}
@ -605,7 +612,7 @@ class ReactExoplayerView extends FrameLayout implements
public void setPlayInBackground(boolean playInBackground) {
// TODO: implement
this.playInBackground = playInBackground;
}
public void setDisableFocus(boolean disableFocus) {