-
-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: play video in background when screen is off #5546
base: master
Are you sure you want to change the base?
Conversation
This also means that the normal player is no longer in sync, which should be discussed first or made optional. |
Lately the audio player is not working in the background .After opening the application, it may revert to the video player |
When the screen is off and only if the video is playing, it switches to the audio player and continues from the last position of the video player. And when the user unlock's the device, he can switch back to the video player by tapping the button in the top right corner and it will continue from the last position of the audio player. (I suggest moving that button down to be easily reachable to the thumb.) Is that what you meant by sync or is it another thing? Btw I found an error that only happens in home screen with this PR. When unlocking the screen and minimizing the player, video cards become invisible. I don't know how to fix but when switching between home tab and another tab, the home screen refreshes and shows the videos. |
Sounds like a pretty good idea imo. Though I think if it switches automatically to adio mode when the screen is turned off, it should also automatically switch back to video, when the device gets unlocked. |
Also, we click the home button and use other applications. It would be great if the audio player starts when you tap the home button. For continuous playback in the background, we need to press the audio + home buttons, then return to the application and press the button again to open the video player. Considering that this is difficult, it is better if we correct it. Note: An option similar to opening a popup when you click the home button. |
another option??, you are right in first like , whenever app is in background whether screen off or on, it should switch to audio, but it'll be annoying if playback stops for sometime while changing the state or you already got the fix @arkibax ? |
I just expressed my opinion. The issue is tagged as a discussion
|
lol, do i really sound that bad, i just asked if you want another option??, idc if it gets another option |
We need an option called "Thanos mode" that when toggled would randomly delete half of the options available in the settings |
i can add that if bnyro is serious about it. second: i am also looking to remove many settings, but i dont know which setting to remove . team libretube should make a list of them in discussion. |
Why are you deleting? I didn't understand |
I think the best behaviour would be to have it switch to the background player when the screen it turned off, and switch back to the video player, seeking to the background player's position when the device is unlocked. |
Yes, he did |
@IndusAryan The playback stops for 1 or 2 seconds while switching. I think it's normal. But if somebody knows how to improve it feel free to review it. This PR as of now, behaves as @M00NJ and @FireMasterK have explained. Btw the bug in the home screen that i mentioned before is still happening. |
From what I understood, this PR is stalled, due to some issue encountered by some users, including the lack of sync between audio and video (and viceversa) players during foreground/background switching. I'm a dev...but not an Android dev (so I don't know how everything exactly works), but can't be eventually possible to run two player instances (video and audio together) and mute one of them depending by the app focus (foreground or background), to keep the sync and bypass every eventual bug caused by the solution in this PR? |
together one will work, but it will require some higher memory as well as cause increased data usage, and syncing problem wont get solved there too, suppose the video loads but the audio track doesnt, and it will also increase some load on piped |
Not necessarily... For example: video player could split audio and video tracks, and use its instance to buffer both for itself and audio player too. Assuming that all this can be done, of course... |
This PR fixes issue #5141.
I took the approach to switch to audio player.