diff --git a/index.js b/index.js index a4ff9c2..fc1412e 100644 --- a/index.js +++ b/index.js @@ -348,15 +348,17 @@ const init = async (items = [], options = {}, index = 0) => { }); swiper.on('slideChange', function () { - for (const [index, slide] of Object.entries(this.slides)) { - if (slide.classList.contains('advdominion-lg__item_video')) { - if (Number(index) === this.activeIndex) { - playVideo(slide); - } else { - pauseVideo(slide); + setTimeout(() => { + for (const [index, slide] of Object.entries(this.slides)) { + if (slide.classList.contains('advdominion-lg__item_video')) { + if (Number(index) === this.activeIndex) { + playVideo(slide); + } else { + pauseVideo(slide); + } } } - } + }); }); swiper.on('resize', function () {