mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2026-11-23 23:57:23 +00:00
fix: continuously save playback progress
This commit is contained in:
1 parent
424996be4f
commit
2f295de282
1 file changed
+6
-2
@@ -1038,8 +1038,12 @@ public final class Player implements PlaybackListener, Listener {
|
||||
return Observable.interval(PROGRESS_LOOP_INTERVAL_MILLIS, MILLISECONDS,
|
||||
AndroidSchedulers.mainThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(ignored -> triggerProgressUpdate(),
|
||||
error -> Log.e(TAG, "Progress update failure: ", error));
|
||||
.subscribe(ignored -> {
|
||||
triggerProgressUpdate();
|
||||
if (isPlaying()) {
|
||||
saveStreamProgressState(simpleExoPlayer.getCurrentPosition());
|
||||
}
|
||||
}, error -> Log.e(TAG, "Progress update failure: ", error));
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
Reference in new issue
Block a user