diff --git a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java index 6781502ea..e419dd672 100644 --- a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java @@ -623,18 +623,18 @@ public abstract class VideoPlayer extends BasePlayer } private void markSegments() { - final VideoSegment[] segments = getVideoSegments(); - - if (segments == null || segments.length == 0) { - return; - } - if (!(playbackSeekBar instanceof MarkableSeekBar)) { return; } final MarkableSeekBar markableSeekBar = (MarkableSeekBar) playbackSeekBar; - markableSeekBar.seekBarMarkers.clear(); + markableSeekBar.clearMarkers(); + + final VideoSegment[] segments = getVideoSegments(); + + if (segments == null || segments.length == 0) { + return; + } for (final VideoSegment segment : segments) { final Integer color = parseSegmentCategory(segment.category); diff --git a/app/src/main/java/org/schabi/newpipe/views/MarkableSeekBar.java b/app/src/main/java/org/schabi/newpipe/views/MarkableSeekBar.java index d37c5c58b..82dcda0c6 100644 --- a/app/src/main/java/org/schabi/newpipe/views/MarkableSeekBar.java +++ b/app/src/main/java/org/schabi/newpipe/views/MarkableSeekBar.java @@ -101,4 +101,9 @@ public class MarkableSeekBar extends AppCompatSeekBar { super.setProgressDrawable(layerDrawable); } + + public void clearMarkers() { + seekBarMarkers.clear(); + super.setProgressDrawable(originalProgressDrawable); + } }