我想在视频(嵌入 Vimeo)播放时暂停 Flickity 自动播放
我的JS
(function($){
$(document).ready(function(){
$(".carousel").flickity({
freeScroll: true,
wrapAround: true,
pageDots: false,
autoPlay: true,
fullscreen: true,
initialIndex: 2,
});
$carousel.flickity('pausePlayer');
})
})(jQuery)
我的 HTML
<div class="carousel" >
<div class="Carousel__Cell"> <div class="player js-player-fullscreen no-playbar with-sticky-custom-logo hide-controls-mode player-lg player-cardsCorner">
<div class="video" style="padding:56.25% 0 0 0;position:relative;" data-vimeo-initialized="true"><iframe src="https://player.vimeo.com/video/559781680?muted=1&autoplay=1&autopause=1&background=1&app_id=122963" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" data-ready="true" allowfullscreen></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
</div>
<div class="Carousel__Cell"> <div class="player js-player-fullscreen no-playbar with-sticky-custom-logo hide-controls-mode player-lg player-cardsCorner">
<div class="video" style="padding:56.25% 0 0 0;position:relative;" data-vimeo-initialized="true"><iframe src="https://player.vimeo.com/video/559781680?muted=1&autoplay=1&autopause=1&background=1&app_id=122963" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" data-ready="true" allowfullscreen></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
</div>
</div>