NewPipe
NewPipe copied to clipboard
Video progress not saved when NewPipe is closed unexpectedly
Checklist
- [X] I am able to reproduce the bug with the latest version.
- [X] I made sure that there are no existing issues - open or closed - which I could contribute my information to.
- [X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- [X] This issue contains only one bug.
- [X] I have read and understood the contribution guidelines.
Affected version
0.22.2
Steps to reproduce the bug
- Start video in background
- Perform resource intensive actions (GPS, browser, ...)
- Wait for the OS to kill NewPipe to save resources
- restart NewPipe
Expected behavior
Video progress is saved in history at the beginning of the video or at the last time the video was paused
Actual behavior
Video progress should be saved more accurately
Screenshots/Screen recordings
No response
Logs
No response
Affected Android/Custom ROM version
e.foundation 11
Affected device model
Samsung Galaxy S5
Additional information
NewPipe should save video progress every 5 seconds at least
I don't think the issue is fixable: We can't save the timestamp if the app got killed unexpectedly.
NewPipe should save video progress every 5 seconds at least
@litetex The point is that whenever the app gets killed unexpectedly, it would already have the timestamp from up to 5 (10? 15?) seconds ago saved. Then when the app is reopened, it can resume from that saved timestamp, which will be negligibly behind the timestamp when the app crashed.
I believe that during playback, the method saveStreamProgressState()
should be called regularly
https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/Player.java
Seems the easiest would be to add saveStreamProgressState() to the onUpdateProgress method
https://github.com/TeamNewPipe/NewPipe/blob/35a118a2a7aa087a389389e035d0ca8163be10ff/app/src/main/java/org/schabi/newpipe/player/Player.java#L852-L864