Merge pull request #2302 from Bnyro/master

Pause the player when leaving app and PiP disabled
This commit is contained in:
Bnyro 2022-12-08 18:28:23 +01:00 committed by GitHub
commit 7b644f3198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1392,7 +1392,9 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
fun onUserLeaveHint() { fun onUserLeaveHint() {
if (usePiP() && shouldStartPiP()) { if (usePiP() && shouldStartPiP()) {
activity?.enterPictureInPictureMode(getPipParams()) activity?.enterPictureInPictureMode(getPipParams())
return
} }
if (!PlayerHelper.pipEnabled) exoPlayer.pause()
} }
@RequiresApi(Build.VERSION_CODES.O) @RequiresApi(Build.VERSION_CODES.O)