libre-tube / LibreTube

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

Playback stops when toggling battery saver #6189

Open flexagoon opened 1 week ago

flexagoon commented 1 week ago

Steps to reproduce

  1. Play any video
  2. While the video is playing, turn on the battery saving mode on your phone (or off if it's already on)

Expected behavior

The video should play without any interruptions

Actual behavior

The app fully reloads and video playback pauses

LibreTube version

0.23.2

Android version

Android 14

Other details

This is especially annoying since Android automatically pauses power saving mode when you connect the phone to a charger, so whenever I plug my phone in or out the app restarts.

Also, this is not related to automatic switching of light/dark mode, it happens even when the app is set to always be in light mode.

Acknowledgements

flexagoon commented 1 week ago

Related:

https://github.com/flutter/flutter/issues/25626#issuecomment-456458586

The fix Flutter used is to add uiMode to android:configChanges

Looking at the documentation for uiMode, it seems like it mostly indicates light/dark mode of the system. So the app restarts are due to the phone switching between light and dark mode, even if LibreTube itself is locked to a specific theme.

I guess the fix for LibreTube is to add uiMode to configChanges and handle the theme change appropriately within the app. If it isn't possible to change the theme without restarting the app for some reason, the change should at least be ignored if the app is set to always be in light mode.

alejandro-alzate commented 1 week ago

This also happens with bluetooth events, battery saving (same), and dark mode toggle. I'll take a video and send it since with my keyboard i can pull the ui reload consistenly. Edit: Also the app doesn't even need to be on the foreground PS: I was passing by the repo to report 2 minor bugs that i have no clue how to trigger. Bonus PSA: I forgot that my keyboard was connected and i was having a though time with the osk, having a comfy goddamm keyboard besides me.

alejandro-alzate commented 1 week ago

"Interface reload" (As you guys refer to it) showcase on my device being triggered by powering on and off my og samsung BT Keyboard: https://www.youtube.com/watch?v=FB109YiEpQ0

Now in that video was shown also a minor bug of a video duped on my watch feed, I AM CLUELESS of how to trigger it but it doesn't bother me and is not a groundbreaking bug.

coming up on breaking sht with alejandro* sometimes the phone lags hard (i mean is an og exynos) Chrashing libretube, the temp meter overlay (thermal monitor) and the live wallpaper (i think i saw a video of how the linux kills random programs when it runs out of memory, that is kinda related) since also the system ui chrashes and so on. The holy grail of IT engineering of just rebooting fixes the issue coming back to the recent task i have a lot of libretube instances, as just u was finishing that sentence the osk (on screen keyboard) closed out of the blue. now aligning my train of thoughts again, the dupes never are seen before the reboot but again i am completely clueless of how i trigger it here's the video for that if you guys wanna look it's just the aftermath after the reboot since i don't think that recording would be stable to do so in the lagged state but i'll try next time: https://www.youtube.com/watch?v=sChKPf8IBmM

I'm heading out change my bio to reflect that I'm a accidental efficient app tester since I'm consistenly breking software even if is not my intention. Bye have a good one!