libre-tube / LibreTube

An alternative frontend for YouTube, for Android.
https://libretube.dev
GNU General Public License v3.0
8.72k stars 447 forks source link

Auto-fullscreen is broken again #5061

Closed DanielProg39 closed 1 year ago

DanielProg39 commented 1 year ago

Steps to reproduce

Make sure that screen orientation in general settings is set to portrait. Make sure auto-fullscreen is enabled in the player settings. Turn the phone to landscape orientation and open a video - the app crashes. Open a video in portrait mode and then rotate the phone to landscape - the video doesn't switch to full screen.

Expected behavior

Video should switch to full screen mode.

Actual behavior

Either the app crashes or nothing happen.

I suppose that this problem is caused by changes aiming to fix #5015

https://github.com/libre-tube/LibreTube/assets/63293432/1f5ffdc8-603e-4d43-b705-5063e4415dec

LibreTube version

LibreTube Debug 0.19.0 commit a212e0a

Android version

Android 13

Other details

Traceback

kotlin.UninitializedPropertyAccessException: lateinit property streams has not been initialized
    at com.github.libretube.ui.fragments.PlayerFragment.setFullscreen(PlayerFragment.kt:529)
    at com.github.libretube.ui.fragments.PlayerFragment.onConfigurationChanged(PlayerFragment.kt:1615)
    at androidx.fragment.app.Fragment.performConfigurationChanged(Fragment.java:3241)
    at androidx.fragment.app.FragmentManager.dispatchConfigurationChanged(FragmentManager.java:3090)
    at androidx.fragment.app.FragmentManager.lambda$new$0$androidx-fragment-app-FragmentManager(FragmentManager.java:469)
    at androidx.fragment.app.FragmentManager$$ExternalSyntheticLambda0.accept(Unknown Source:4)
    at androidx.activity.ComponentActivity.onConfigurationChanged(ComponentActivity.java:919)
    at androidx.appcompat.app.AppCompatActivity.onConfigurationChanged(AppCompatActivity.java:229)
    at com.github.libretube.ui.activities.MainActivity.onConfigurationChanged(MainActivity.kt:486)
    at android.app.ActivityThread.performActivityConfigurationChanged(ActivityThread.java:5947)
    at android.app.ActivityThread.performConfigurationChangedForActivity(ActivityThread.java:5861)
    at android.app.ActivityThread.handleActivityConfigurationChanged(ActivityThread.java:6181)
    at android.app.servertransaction.ActivityConfigurationChangeItem.execute(ActivityConfigurationChangeItem.java:53)
    at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7924)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Acknowledgements

DanielProg39 commented 1 year ago

Here's a new issue. When I stop the video, turn the screen off, turn it on and turn my phone horisontally, the video doesn't expand to full screen. It does only when minimised and reopened. I tried to reproduce this behavior, you can see it below.

https://github.com/libre-tube/LibreTube/assets/63293432/1930de75-8154-4d20-910b-deb565b2a6a5