Stop playback when activity is paused

This commit is contained in:
jarnedemeulemeester 2021-08-12 15:16:59 +02:00
parent 09589cd813
commit c7683e19b3
No known key found for this signature in database
GPG key ID: 60884A0C1EBA43E5

View file

@ -43,6 +43,11 @@ class PlayerActivity : AppCompatActivity() {
hideSystemUI()
}
override fun onPause() {
super.onPause()
playerView.player?.playWhenReady = false
}
@Suppress("DEPRECATION")
private fun hideSystemUI() {
// These methods are deprecated but we still use them because the new WindowInsetsControllerCompat has a bug which makes the action bar reappear