reset segments when closing videos

This commit is contained in:
caneleex 2021-07-23 17:44:42 +02:00
parent 13a12c9523
commit fc3fb979ba
2 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,8 @@ public class PlayerController {
public static void setCurrentVideoId(final String videoId) {
if (videoId == null) {
Log.d(TAG, "setCurrentVideoId: videoId is null");
currentVideoId = null;
sponsorSegmentsOfCurrentVideo = null;
return;
}

View File

@ -616,7 +616,7 @@ public abstract class SponsorBlockUtils {
}
public static String getTimeWithoutSegments() {
if (!SponsorBlockSettings.isSponsorBlockEnabled || sponsorSegmentsOfCurrentVideo == null) {
if (!SponsorBlockSettings.isSponsorBlockEnabled || !SponsorBlockSettings.showTimeWithoutSegments || sponsorSegmentsOfCurrentVideo == null) {
return "";
}
long timeWithoutSegments = PlayerController.getCurrentVideoLength();
@ -631,6 +631,7 @@ public abstract class SponsorBlockUtils {
try {
if (videoHasSegments && (playerType.equalsIgnoreCase("NONE"))) {
needToAppendTime = true;
PlayerController.setCurrentVideoId(null);
return;
}
}