×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Ruhul Amin
Added: Apr 6, 2021 8:45 PM
Views: 4028
Tags: no tags
  1.     owl.on("translated.owl.carousel", function (event) {
  2.       var isPlaying =
  3.         this.currentTime > 0 &&
  4.         !this.paused &&
  5.         !this.ended &&
  6.         this.readyState > this.HAVE_CURRENT_DATA;
  7.       owl.find(".owl-item video").each(function () {
  8.         if (isPlaying) {
  9.           this.pause();
  10.           this.currentTime = 0;
  11.         }
  12.       });
  13.       owl.find(".owl-item.active video").each(function () {
  14.         this.play();
  15.         this.onended = function () {
  16.           owl.trigger("next.owl.carousel");
  17.         };
  18.       });
  19.     });
  20.  
  21.     $(window).on("load", function () {
  22.       owl.trigger("refresh.owl.carousel"); // owl full width problem
  23.       // on owl insialized
  24.       owl.find(".owl-item.active video").each(function () {
  25.         this.play();
  26.         this.onended = function () {
  27.           owl.trigger("next.owl.carousel");
  28.         };
  29.       });
  30.     });