Allow a BasePlayer to start paused#2917
Allow a BasePlayer to start paused#2917TobiGr merged 3 commits intoTeamNewPipe:devfrom raphj:patch-1
Conversation
|
Could you provide an apk to test? |
|
app-debug.zip |
|
There is something wrong with the apk... I have "Minimize on app switch to background player" active and when I switch away from a playing video in the main player, I get a strange-looking background player notification (i.e. the progress bar is missing). |
|
Ok, I'm seeing another bug as well that I didn't encounter during my tests: Playing a video and then minimizing does not resume playing. I'm going to look into it. |
|
I am investigating. On the version published on F-Droid, I am seeing this exception when playing a fullscreen video, and then clicking on the background button: |
|
All right so I didn't understand well the meaning of the RESUME_PLAYBACK field. There are two places it is set to true across the code base, and it is in fragments/detail/VideoDetailFragment. I should not touch this for this pull request. It seems to me that a new field in the intent is needed: isPaused. I am going to experiment with this, but feel free to stop me if it does not seems to be a good solution. |
This allows fixing spurious playback resume when minimizing to the background player.
|
I think I got it fixed. I tested switching:
I don't know how to switch from the popup player to the background player. To be completely honest, I did spot situations where when playing in the main player and switching to the background player, playback is not resumed, but I didn't find a way to replicate this and I am not sure the issue comes from my code. I think the fields of the intent need to be documented, though I would need help for this. @Stypox does it look good to you? |
|
We will probably have to rebase this on top of #2907. |
TobiGr
left a comment
There was a problem hiding this comment.
Thanks!
You do not only fix a bug, but also improve code quality. Nice job!
This commit fixes the situation where NewPipe is set up to play in the background when minimizing its window.
In this situation, without this pull request, the video is incorrectly resumed in the background.
I hesitated whether I would set the default value to true of false. I chose to pick true to be closer to the current behavior, please let me know if it would be better to use false or fill free to edit.
[X] I carefully read the contribution guidelines and agree to them.