Более корректное воспроизведение видео при быстром пролистывании (fix)
This commit is contained in:
parent
c710fdd56a
commit
f953780e84
16
index.js
16
index.js
|
@ -348,15 +348,17 @@ const init = async (items = [], options = {}, index = 0) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
swiper.on('slideChange', function () {
|
swiper.on('slideChange', function () {
|
||||||
for (const [index, slide] of Object.entries(this.slides)) {
|
setTimeout(() => {
|
||||||
if (slide.classList.contains('advdominion-lg__item_video')) {
|
for (const [index, slide] of Object.entries(this.slides)) {
|
||||||
if (Number(index) === this.activeIndex) {
|
if (slide.classList.contains('advdominion-lg__item_video')) {
|
||||||
playVideo(slide);
|
if (Number(index) === this.activeIndex) {
|
||||||
} else {
|
playVideo(slide);
|
||||||
pauseVideo(slide);
|
} else {
|
||||||
|
pauseVideo(slide);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
swiper.on('resize', function () {
|
swiper.on('resize', function () {
|
||||||
|
|
Loading…
Reference in New Issue