title: The video in previous slide is also playing in swiperjs
body: <pre><code>&lt;div class=&quot;swiper mySwiper&quot;&gt;
    &lt;div class=&quot;swiper-wrapper&quot;&gt;
      &lt;div class=&quot;swiper-slide&quot;&gt;
        &lt;video-js
          id=&quot;overlayVideo&quot;
          class=&quot;overlayVideo&quot;
          data-account=&quot;1752604059001&quot;
          data-player=&quot;default&quot;
          data-embed=&quot;default&quot;
          controls=&quot;&quot;
          data-video-id=&quot;4029697544001&quot;
          data-playlist-id=&quot;&quot;
          data-application-id=&quot;&quot;
          data-object-fit=&quot;cover&quot;
          autoplay
          muted
          playsinline
        &gt;
        &lt;/video-js&gt;
        &lt;script src=&quot;https://players.brightcove.net/1752604059001/default_default/index.min.js&quot;&gt;&lt;/script&gt;
      &lt;/div&gt;
      &lt;div class=&quot;swiper-slide&quot;&gt;
        &lt;video-js
          id=&quot;overlayVideo&quot;
          class=&quot;overlayVideo&quot;
          data-account=&quot;6269594386001&quot;
          data-player=&quot;oHG2GzKTGk&quot;
          data-embed=&quot;default&quot;
          controls=&quot;&quot;
          data-video-id=&quot;6304418462001&quot;
          data-playlist-id=&quot;&quot;
          data-application-id=&quot;&quot;
          data-object-fit=&quot;cover&quot;
          autoplay
          muted
          playsinline
        &gt;
        &lt;/video-js&gt;
        &lt;script src=&quot;https://players.brightcove.net/6269594386001/oHG2GzKTGk_default/index.min.js&quot;&gt;&lt;/script&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;swiper-button-next&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;swiper-button-prev&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;swiper-pagination&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  $(document).ready(function () {
    var swiper = new Swiper(&quot;.mySwiper&quot;, {
      rewind: true,
      spaceBetween: 30,
      centeredSlides: true,
      autoplay: {
        delay: 2500,
        disableOnInteraction: false,
      },
      pagination: {
        el: &quot;.swiper-pagination&quot;,
        clickable: true,
      },
      navigation: {
        nextEl: &quot;.swiper-button-next&quot;,
        prevEl: &quot;.swiper-button-prev&quot;,
      },
    });
  
    $(&quot;.vjs-tech&quot;).on(&quot;play&quot;, function () {
      swiper.autoplay.stop();
    });
  
    $(&quot;.vjs-tech&quot;).on(&quot;ended, pause&quot;, function () {
      swiper.autoplay.start();
    });
  
    var sliderVideos = $(&quot;.swiper-slide .vjs-tech&quot;);
  
    swiper.on('slideChange', function () {
            /* stop all videos (currentTime buggy without this loop idea - no &quot;real&quot; previousIndex) */     
            sliderVideos.each(function( index ) {
              this.currentTime = 0;
              this.play();
            });
          });
    
  });
  </code></pre>
  <p>Currently I am autoplaying the video in muted state. I have written a logic like if the video is playing the autoplay option in swiper should stop. Once the video is ended or paused then the autoplay should start. Currently if I unmute the video in first slide and try to play the autoscroll is paused till the video gets paused or ended, but on moving to the next slide the video in first slide is also playing and it is not getting muted or paused on slide change. Need help in resolving this issue. Thanks in advance</p>