Don't set isPaused when releasing the player

I'm guessing this was a bug as it doesn't make sense that we would set paused to true if the video is playing, and not paused if it wasn't. I believe this is a safe change since we only release the player when the app is closing or we detach (which is going away shortly). We need this since we release the player in order to apply new bufferConfig settings.
This commit is contained in:
Hampton Maxwell 2018-08-03 15:54:18 -07:00 committed by GitHub
parent 9ff16ed550
commit 725497e149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,7 +328,6 @@ class ReactExoplayerView extends FrameLayout implements
private void releasePlayer() {
if (player != null) {
isPaused = player.getPlayWhenReady();
updateResumePosition();
player.release();
player.setMetadataOutput(null);
@ -941,11 +940,11 @@ class ReactExoplayerView extends FrameLayout implements
}
public void setBufferConfig(int newMinBufferMs, int newMaxBufferMs, int newBufferForPlaybackMs, int newBufferForPlaybackAfterRebufferMs) {
stopPlayback();
minBufferMs = newMinBufferMs;
maxBufferMs = newMaxBufferMs;
bufferForPlaybackMs = newBufferForPlaybackMs;
bufferForPlaybackAfterRebufferMs = newBufferForPlaybackAfterRebufferMs;
releasePlayer();
initializePlayer();
}
}