Save playback state even if stream is finished and add isFinished()

This commit is contained in:
Stypox 2021-03-26 11:27:25 +01:00
parent e846f69e38
commit 360f5ac6f7
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
4 changed files with 38 additions and 13 deletions

View file

@ -671,7 +671,11 @@ public final class Player implements
//.doFinally()
.subscribe(
state -> {
newQueue.setRecovery(newQueue.getIndex(), state.getProgressTime());
if (!state.isFinished(newQueue.getItem().getDuration())) {
// resume playback only if the stream was not played to the end
newQueue.setRecovery(newQueue.getIndex(),
state.getProgressTime());
}
initPlayback(newQueue, repeatMode, playbackSpeed, playbackPitch,
playbackSkipSilence, playWhenReady, isMuted);
},