Fix bug with playInBackground
This commit is contained in:
parent
f7b7f2666a
commit
ee5818b6ff
@ -167,9 +167,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
if (playInBackground) {
|
||||
return;
|
||||
}
|
||||
stopPlayback();
|
||||
}
|
||||
|
||||
@ -209,12 +206,14 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
player.setMetadataOutput(this);
|
||||
exoPlayerView.setPlayer(player);
|
||||
audioBecomingNoisyReceiver.setListener(this);
|
||||
setPlayWhenReady(!isPaused);
|
||||
playerNeedsSource = true;
|
||||
|
||||
PlaybackParameters params = new PlaybackParameters(rate, 1f);
|
||||
player.setPlaybackParameters(params);
|
||||
}
|
||||
|
||||
setPlayWhenReady(!isPaused);
|
||||
|
||||
if (playerNeedsSource && srcUri != null) {
|
||||
MediaSource mediaSource = buildMediaSource(srcUri, extension);
|
||||
mediaSource = repeat ? new LoopingMediaSource(mediaSource) : mediaSource;
|
||||
|
Loading…
Reference in New Issue
Block a user