fix: media keeps playing after closing pip

This commit is contained in:
tapframe 2026-04-10 20:36:45 +05:30
parent 91cf6e62c5
commit e19fcd08e3

View file

@ -240,7 +240,8 @@ actual fun PlatformPlayerSurface(
Lifecycle.Event.ON_STOP -> {
val isInPictureInPicture =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && activity?.isInPictureInPictureMode == true
if (!isInPictureInPicture) {
val isFinishing = activity?.isFinishing == true
if (!isInPictureInPicture || isFinishing) {
exoPlayer.pause()
}
}