Browse Source

minor pip mode fixes

pull/34/head
Jannik 1 year ago
parent
commit
1a9de4124d
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 10
      app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerActivity.kt

10
app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerActivity.kt

@ -127,6 +127,8 @@ class PlayerActivity : AppCompatActivity() {
// if the player was in pip, it's on a different task
if (wasInPiP) { navToLauncherTask() }
// if the player is in pip, remove the task, else we'll get a zombie
if (isInPiPMode()) { finishAndRemoveTask() }
}
override fun onSaveInstanceState(outState: Bundle) {
@ -184,9 +186,7 @@ class PlayerActivity : AppCompatActivity() {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
// Hide the full-screen UI (controls, etc.) while in picture-in-picture mode.
if (isInPictureInPictureMode) {
controller.hideImmediately()
}
video_view.useController = !isInPictureInPictureMode
}
private fun initPlayer() {
@ -199,8 +199,8 @@ class PlayerActivity : AppCompatActivity() {
initTimeUpdates()
// if the player is ready or buffering we can simply play the file again, else do nothing
if ((model.player.playbackState == ExoPlayer.STATE_READY || model.player.playbackState == ExoPlayer.STATE_BUFFERING)
) {
val playbackState = model.player.playbackState
if ((playbackState == ExoPlayer.STATE_READY || playbackState == ExoPlayer.STATE_BUFFERING)) {
model.player.play()
}
}

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close