NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Video progress not saved when NewPipe is closed unexpectedly

Open mildred opened this issue 2 years ago • 5 comments

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

mildred avatar May 05 '22 21:05 mildred

I am able to reproduce the bug with the latest version.

That's not the latest version.

opusforlife2 avatar May 05 '22 21:05 opusforlife2

I don't think the issue is fixable: We can't save the timestamp if the app got killed unexpectedly.

litetex avatar May 06 '22 18:05 litetex

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.

opusforlife2 avatar May 06 '22 19:05 opusforlife2

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

mildred avatar Aug 01 '22 15:08 mildred

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

mildred avatar Aug 01 '22 15:08 mildred