Stop playback when activity is paused
This commit is contained in:
parent
09589cd813
commit
c7683e19b3
1 changed files with 5 additions and 0 deletions
|
@ -43,6 +43,11 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
hideSystemUI()
|
hideSystemUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
playerView.player?.playWhenReady = false
|
||||||
|
}
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
private fun hideSystemUI() {
|
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
|
// These methods are deprecated but we still use them because the new WindowInsetsControllerCompat has a bug which makes the action bar reappear
|
||||||
|
|
Loading…
Reference in a new issue