0
0
Fork 0
mirror of https://github.com/YTVanced/Integrations synced 2024-10-31 16:32:39 +00:00

reset segments when closing videos

This commit is contained in:
caneleex 2021-07-23 17:44:42 +02:00
parent f6af032a89
commit 43b3a31119
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) { public static void setCurrentVideoId(final String videoId) {
if (videoId == null) { if (videoId == null) {
Log.d(TAG, "setCurrentVideoId: videoId is null"); currentVideoId = null;
sponsorSegmentsOfCurrentVideo = null;
return; return;
} }

View file

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