Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Added flag for background mode (TheWidlarzGroup#563)
Browse files Browse the repository at this point in the history
* Added flag for background mode

* Better flag name
  • Loading branch information
deshiknaves authored and wschurman committed Jul 13, 2017
1 parent 726e65d commit e9b1729
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class ReactExoplayerView extends FrameLayout implements
private boolean repeat;
private boolean disableFocus;
private float mProgressUpdateInterval = 250.0f;
private boolean playInBackground = false;
// \ End props

// React
Expand Down Expand Up @@ -168,11 +169,17 @@ protected void onDetachedFromWindow() {

@Override
public void onHostResume() {
if (playInBackground) {
return;
}
setPlayWhenReady(!isPaused);
}

@Override
public void onHostPause() {
if (playInBackground) {
return;
}
setPlayWhenReady(false);
}

Expand Down Expand Up @@ -550,7 +557,7 @@ public void setRateModifier(float rate) {


public void setPlayInBackground(boolean playInBackground) {
// TODO: implement
this.playInBackground = playInBackground;
}

public void setDisableFocus(boolean disableFocus) {
Expand Down

0 comments on commit e9b1729

Please sign in to comment.