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() } diff --git a/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt b/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt index ee6279b..8052bcc 100644 --- a/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt +++ b/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt @@ -605,8 +605,6 @@ class MPVActivity : AppCompatActivity(), MPVLib.EventObserver { override fun onDestroy() { Log.v(TAG, "Exiting.") - saveProgress() - @Suppress("DEPRECATION") audioManager.abandonAudioFocus(audioFocusChangeListener)