Swiper轮播切换暂停youbute视频

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32279193/article/details/87288132
 new swiper('.J-video-swiper',{
                navigation: {
                    nextEl: '.J-video-swiper .swiper-button-next',
                    prevEl: '.J-video-swiper .swiper-button-prev',
                },
                on: {
                    slideChangeTransitionEnd: function(){
                        var $previousVideoIframe = $('.J-video-swiper .swiper-slide').eq(this.previousIndex).find('.v-iframe-box iframe');
                        $previousVideoIframe[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*')
						//stopVideo:停止视频; pauseVideo:暂停; playVideo:播放视频		
					},
                }
			});

猜你喜欢

转载自blog.csdn.net/qq_32279193/article/details/87288132