Fix playback timer flickering issue while streaming and downloading episode at the same time (#6268)

This commit is contained in:
GitStart 2023-01-24 21:20:58 +03:00 committed by GitHub
parent cb2cc7a357
commit 13439e1a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -226,6 +226,10 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder {
}
private void updateDuration(PlaybackPositionEvent event) {
if (getFeedItem().getMedia() != null) {
getFeedItem().getMedia().setPosition(event.getPosition());
getFeedItem().getMedia().setDuration(event.getDuration());
}
int currentPosition = event.getPosition();
int timeDuration = event.getDuration();
int remainingTime = Math.max(timeDuration - currentPosition, 0);