Более корректное воспроизведение видео при быстром пролистывании (fix)
This commit is contained in:
		
							
								
								
									
										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 () { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user