Более корректное воспроизведение видео при быстром пролистывании (fix)

This commit is contained in:
Valentin Silytuin 2025-04-24 23:59:38 +04:00
parent c710fdd56a
commit f953780e84
1 changed files with 9 additions and 7 deletions

View File

@ -348,6 +348,7 @@ const init = async (items = [], options = {}, index = 0) => {
});
swiper.on('slideChange', function () {
setTimeout(() => {
for (const [index, slide] of Object.entries(this.slides)) {
if (slide.classList.contains('advdominion-lg__item_video')) {
if (Number(index) === this.activeIndex) {
@ -358,6 +359,7 @@ const init = async (items = [], options = {}, index = 0) => {
}
}
});
});
swiper.on('resize', function () {
if (isVideoInGallery.yt || isVideoInGallery.vk || isVideoInGallery.rt) {