Fix active slide detection logic in SlideCreator for improved video playback handling

This commit is contained in:
CodeDevMLH
2026-03-06 02:23:13 +01:00
parent fba64bd0f6
commit 53ad568be4

View File

@@ -1735,7 +1735,8 @@ const SlideCreator = {
}
const isLowPower = isLowPowerDevice();
const isActiveSlide = index === STATE.slideshow.currentSlideIndex;
const itemIndex = STATE.slideshow.itemIds ? STATE.slideshow.itemIds.indexOf(itemId) : -1;
const isActiveSlide = itemIndex !== -1 && itemIndex === STATE.slideshow.currentSlideIndex;
const shouldCreateVideo = !isLowPower || isActiveSlide;
if (isYoutube && videoId && shouldCreateVideo) {