From e22981ee3486a6a5546eeadde68eaa97ff8be076 Mon Sep 17 00:00:00 2001 From: Michele Pozzi <123.mpozzi@gmail.com> Date: Wed, 6 Nov 2024 15:11:13 +0100 Subject: [PATCH] Move statement inside block --- .../main/java/com/bitmovin/player/reactnative/RNPlayerView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt b/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt index cfde71f5..1593b78f 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt @@ -132,7 +132,6 @@ class RNPlayerView( } override fun onStop(owner: LifecycleOwner) { - playerInMediaSessionService = null removePlayerForBackgroundPlayback() playerView?.onStop() } @@ -142,6 +141,7 @@ class RNPlayerView( // When background playback is enabled, // remove player from view so it does not get paused when entering background private fun removePlayerForBackgroundPlayback() { + playerInMediaSessionService = null playerView?.player?.let { if (!enableBackgroundPlayback) { return