-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Video progress resets when switching to popup/background and viceversa #7427
Comments
Sounds like a duplicate of #7303 to me, but I'm not exactly sure what the reproduction steps in your issue are since you didn't fill out that section, so please do that. :) |
mb, I forgot to delete the comment brackets. It should be the same as #7303, tho the author there did not mention the problem happening to popup or the possibility for the video to resume from the last pause timestamp instead of restarting. |
@Dangelman Could you provide the exact steps? As I've written in the issue, it takes 2 switches for the bug to happen for me. Your steps seem to contain only one switch. Something is missing here. |
@opusforlife2 It's as I described.
The video restarts instead of continuing, or jump back to the last timestamp you paused previously. |
https://streamable.com/dsae9q (change resolution if video freezes. There's a 15s buffering at the beginning, see below) |
This doesn't happen for me after step 4. Could you try it from a different phone? |
Code analysis:
When looking at this big NewPipe/app/src/main/java/org/schabi/newpipe/player/Player.java Lines 637 to 713 in d8236bb
2. User changed a player from, for example. main to popup, or from audio to main, etc is not working. When I press "Play in background", 1. User pressed on a timestamp link and the same video should be rewound to the timestamp is executed instead.The key code-line seems to be
Proposed solutions:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rancidfrog |
after following the lead from litetex , I found the issue may caused by not properly updating the streamProgressState so i did update it before change stream to popup or background player and it worked . NewPipe/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java Lines 439 to 445 in d8236bb
to switch (v.getId()) {
case R.id.detail_controls_background:
player.saveStreamProgressState();
openBackgroundPlayer(false);
break;
case R.id.detail_controls_popup:
player.saveStreamProgressState();
openPopupPlayer(false);
break; i'm new to this repo , would love to hear further from u guys . |
@akberkhan-time this seems to be working fine indeed, nice job! Note it should also be done for |
just popping in to say I have had this issue as well. Using a S20 Ultra on the latest version |
Downgraded to v0.21.10 worked for me |
any news about a solution for this bug |
Yeah, this change in v0.21.15 didn't fix the issue for me in Android 12: "Removed MediaParser support to fix failing playback resume after buffering on Android 11+." Please implement akberkhan-time's streamProgressState findings into a new release. I often switch between full screen, pop-up, and background modes and this bug has made the app nearly unusable for me. Until then, I'm reverting to v0.21.10 like drewsat suggested. |
There is no way it could have. It's an unrelated PR. If you open it, you'll see the linked issue which that PR addresses. |
Just wanted to share I also have had this issue. It's the worst to be watching a really long video, and then randomly have it snap back to the beginning again because you turned off the screen. |
I have this issue. Workaround: pause the video before switching how it's being played. Always solves it for me. |
@TheShanMan Awesome. I'm linking this up top. |
I tried to quickly fix the underlying problem - where the code tries to discover what happens based on parameter that don't describe what actually happens - but the code is a spaghetti monster of doom Occasions where the player is changed or startedSummarized call hierarchy: or as plain text:
Did a quick and dirty fix with #7668 instead. Someone should do a followup PR where the code is refactored. |
No wonder I experience race condition crashes for years. |
Workaround: #7427 (comment)
Checklist
Steps to reproduce the bug
Actual behavior
The video progress will reset to either the start or the video or the last timestamp you paused it. The opposite is also true (especially switching from background to main player). I have auto-rotate disabled, if it can help.
Expected behavior
The video should progress from the same point (or 1-2 seconds before).
Screenshots/Screen recordings
#7427 (comment)
(change resolution if video freezes)
Logs
Device info
The text was updated successfully, but these errors were encountered: