From 725497e149cbe2308a3848e9af4dbbbefe9cf210 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Fri, 3 Aug 2018 15:54:18 -0700 Subject: [PATCH] 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. --- .../main/java/com/brentvatne/exoplayer/ReactExoplayerView.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 60f74416..9ef099cf 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -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(); } }