Fix setFullScree() call when in PiP mode

When activity is in PiP mode it gives orientation as landscape, which leads to unwanted `setFullscreen()`.
This commit is contained in:
Krunal Patel 2022-11-29 20:02:42 +05:30
parent 15e16fcae6
commit f8676682bf

View File

@ -1411,6 +1411,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
super.onConfigurationChanged(newConfig)
if (!PlayerHelper.autoRotationEnabled) return
// If in PiP mode, orientation is given as landscape.
if (SDK_INT >= Build.VERSION_CODES.N && activity?.isInPictureInPictureMode == true) return
when (newConfig.orientation) {
// go to fullscreen mode
Configuration.ORIENTATION_LANDSCAPE -> setFullscreen()