Skip to content

Commit

Permalink
Merge pull request #92 from itszechs/patch-remember-playback
Browse files Browse the repository at this point in the history
Fix: Save last playback position
  • Loading branch information
itszechs authored Feb 9, 2023
2 parents 4ac787e + ec899e0 commit e052354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ class PlayerActivity : AppCompatActivity() {
if (isInPictureInPictureMode) hideController() else showController()
}
if (onStopCalled) {
saveProgress()
finish()
}
}
Expand All @@ -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
Expand All @@ -671,7 +676,6 @@ class PlayerActivity : AppCompatActivity() {
}

override fun onDestroy() {
saveProgress()
releasePlayer()
super.onDestroy()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,6 @@ class MPVActivity : AppCompatActivity(), MPVLib.EventObserver {
override fun onDestroy() {
Log.v(TAG, "Exiting.")

saveProgress()

@Suppress("DEPRECATION")
audioManager.abandonAudioFocus(audioFocusChangeListener)

Expand Down

0 comments on commit e052354

Please sign in to comment.