1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-09-10 14:55:59 +00:00

Merge pull request #7381 from litetex/prevent-automatic-replay-after-returning-from-background

Prevent automatic replay after returning from background
This commit is contained in:
XiangRongLin
2021-11-17 09:38:09 +01:00
committed by GitHub

View File

@@ -857,10 +857,10 @@ public final class Player implements
final int queuePos = playQueue.getIndex();
final long windowPos = simpleExoPlayer.getCurrentPosition();
final long duration = simpleExoPlayer.getDuration();
if (windowPos > 0 && windowPos <= simpleExoPlayer.getDuration()) {
setRecovery(queuePos, windowPos);
}
// No checks due to https://github.com/TeamNewPipe/NewPipe/pull/7195#issuecomment-962624380
setRecovery(queuePos, Math.max(0, Math.min(windowPos, duration)));
}
private void setRecovery(final int queuePos, final long windowPos) {