如何暂停视频HTML下一张幻灯片(使用video.js和swiper.js)

时间:2018-07-30 08:06:25

标签: javascript html5-video video.js

我正在swiper.js滑块video.js中演示一些视频。我想做的是:由于视频处于自动播放状态,因此当用户滑动到下一张幻灯片时,我希望上一个视频幻灯片在javascript中暂停/停止,

感谢您的帮助!

Blg

<!-- Slider main container -->
    <div class="swiper-container">
       <div class="swiper-slide-overlay">
                    <h1>Title</h1>
                    <h2>Sub-title</h2>
                </div>
        <!-- Additional required wrapper -->
        <div class="swiper-wrapper">
            <!-- Slides -->
            <div class="swiper-slide">
                <video id="my_video_1" class="video-js vjs-default-skin" controls ControlBar="none" loop autoplay controlsList="nodownload" preload="true">
                    <source src="assets/video/video1.mp4" />
                </video>
            </div>

            <div class="swiper-slide">
                <img class="img" src="assets/img/vinyl.jpg" alt=""/>
            </div>

            <div class="swiper-slide">
                <img class="img" src="assets/img/mix.jpg" alt=""/>
            </div>
       </div>

0 个答案:

没有答案