SponsorBlock: Fixed an issue where marked segments would persist on videos with no segments
The MarkableSeekBar now has a way to clear the marked segments.
This commit is contained in:
parent
63eb637ec0
commit
cd9ff1a48f
2 changed files with 12 additions and 7 deletions
|
@ -623,18 +623,18 @@ public abstract class VideoPlayer extends BasePlayer
|
||||||
}
|
}
|
||||||
|
|
||||||
private void markSegments() {
|
private void markSegments() {
|
||||||
final VideoSegment[] segments = getVideoSegments();
|
|
||||||
|
|
||||||
if (segments == null || segments.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(playbackSeekBar instanceof MarkableSeekBar)) {
|
if (!(playbackSeekBar instanceof MarkableSeekBar)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final MarkableSeekBar markableSeekBar = (MarkableSeekBar) playbackSeekBar;
|
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) {
|
for (final VideoSegment segment : segments) {
|
||||||
final Integer color = parseSegmentCategory(segment.category);
|
final Integer color = parseSegmentCategory(segment.category);
|
||||||
|
|
|
@ -101,4 +101,9 @@ public class MarkableSeekBar extends AppCompatSeekBar {
|
||||||
|
|
||||||
super.setProgressDrawable(layerDrawable);
|
super.setProgressDrawable(layerDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearMarkers() {
|
||||||
|
seekBarMarkers.clear();
|
||||||
|
super.setProgressDrawable(originalProgressDrawable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue