Merge pull request #4870 from Bnyro/master

fix: crash when starting video upon auto fullscreen
This commit is contained in:
Bnyro 2023-09-29 11:25:30 +02:00 committed by GitHub
commit f00180aa0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1331,6 +1331,10 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
} }
private fun updateResolutionOnFullscreenChange(isFullscreen: Boolean) { private fun updateResolutionOnFullscreenChange(isFullscreen: Boolean) {
// this occurs when the user has the phone in landscape mode and it thus rotates when
// opening a new video
if (!this::trackSelector.isInitialized) return
if (!isFullscreen && noFullscreenResolution != null) { if (!isFullscreen && noFullscreenResolution != null) {
setPlayerResolution(noFullscreenResolution!!) setPlayerResolution(noFullscreenResolution!!)
} else { } else {