From ec899e07d086c566b77b79cec4a0c1ec039db186 Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 16:59:27 +0530 Subject: [PATCH] exo: fix save onPause and pipClose --- .../java/zechs/drive/stream/ui/player/PlayerActivity.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt b/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt index fbb02d4..54b4e89 100644 --- a/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt +++ b/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt @@ -649,6 +649,7 @@ class PlayerActivity : AppCompatActivity() { if (isInPictureInPictureMode) hideController() else showController() } if (onStopCalled) { + saveProgress() finish() } } @@ -658,8 +659,12 @@ class PlayerActivity : AppCompatActivity() { updateOrientation(newConfig) } - override fun onStop() { + override fun onPause() { saveProgress() + super.onPause() + } + + override fun onStop() { player.pause() super.onStop() onStopCalled = true @@ -671,7 +676,6 @@ class PlayerActivity : AppCompatActivity() { } override fun onDestroy() { - saveProgress() releasePlayer() super.onDestroy() }