Skip to content

Commit

Permalink
Merge pull request #833 from moduval/master
Browse files Browse the repository at this point in the history
Fix playInBackground props in ExoPlayer
  • Loading branch information
cobarx authored Jun 9, 2018
2 parents 65c3696 + da7bd43 commit 24766c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions android-exoplayer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ https://github.com/google/ExoPlayer

## Unimplemented props

- `playInBackground={true}`
- `rate={1.0}`
- Expansion file - `source={{ mainVer: 1, patchVer: 0 }}`

Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class ReactExoplayerView extends FrameLayout implements
private long resumePosition;
private boolean loadVideoStarted;
private boolean isFullscreen;
private boolean isInBackground;
private boolean isPaused = true;
private boolean isBuffering;
private float rate = 1f;
Expand Down Expand Up @@ -186,14 +187,15 @@ protected void onDetachedFromWindow() {

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

@Override
public void onHostPause() {
isInBackground = true;
if (playInBackground) {
return;
}
Expand Down

0 comments on commit 24766c2

Please sign in to comment.