diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 19018bdb88..2fc44aff23 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -1300,7 +1300,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { } } - private fun setPlayerResolution(resolution: Int, isSelectedByUser: Boolean) { + private fun setPlayerResolution(resolution: Int, isSelectedByUser: Boolean = false) { val transformedResolution = if (!isSelectedByUser && isShort) { ceil(resolution * 16.0 / 9.0).toInt() } else { @@ -1319,9 +1319,9 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { if (!this::trackSelector.isInitialized) return if (!isFullscreen && noFullscreenResolution != null) { - setPlayerResolution(noFullscreenResolution!!, false) + setPlayerResolution(noFullscreenResolution!!) } else if (fullscreenResolution != null) { - setPlayerResolution(fullscreenResolution ?: Int.MAX_VALUE, false) + setPlayerResolution(fullscreenResolution ?: Int.MAX_VALUE) } } @@ -1498,10 +1498,11 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { var newResolution = resolutions[which].resolution setPlayerResolution(newResolution, true) - // save the selected resolution to update on fullscreen change if (isShort) { newResolution = ceil(newResolution * 9.0 / 16.0).toInt() } + + // save the selected resolution to update on fullscreen change if (noFullscreenResolution != null && viewModel.isFullscreen.value != true) { noFullscreenResolution = newResolution } else {