fix: continuously save playback progress

This commit is contained in:
ulrik elmelund authored and Tobi committed 2026-11-23 10:34:25 +01:00
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