Unverified Commit 725497e1 authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

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.
parent 9ff16ed5
Loading
Loading
Loading
Loading
+1 −2
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -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();
    }
}