Apply fix in playInBackground props

This commit is contained in:
Marc-Olivier Duval 2017-10-24 21:49:46 -04:00
parent f73b7a0484
commit f7b7f2666a

View File

@ -167,6 +167,9 @@ class ReactExoplayerView extends FrameLayout implements
@Override @Override
protected void onDetachedFromWindow() { protected void onDetachedFromWindow() {
super.onDetachedFromWindow(); super.onDetachedFromWindow();
if (playInBackground) {
return;
}
stopPlayback(); stopPlayback();
} }
@ -174,9 +177,6 @@ class ReactExoplayerView extends FrameLayout implements
@Override @Override
public void onHostResume() { public void onHostResume() {
if (playInBackground) {
return;
}
setPlayWhenReady(!isPaused); setPlayWhenReady(!isPaused);
} }