Antrium A35D

Bir sonraki için en iyisini yap...

OWL Carousel 2.3.4 change Youtube Video pause (iframe video pause)

HTML KODU;
 

<div class="item">
  <div class="flex-video">
    <iframe src="https://www.youtube.com/embed/G1lq40tR72Q?enablejsapi=1" width="560" allowfullscreen frameborder="0" height="315"></iframe>
  </div>
</div>

JAVASCRIPTKODU;
 

 onTranslate: function(event) {
    var currentSlide, player, command;

    currentSlide = $('.owl-item.active');

    player = currentSlide.find(".flex-video iframe").get(0);

    command = {
        "event": "command",
        "func": "pauseVideo"
    };

    if (player != undefined) {
        player.contentWindow.postMessage(JSON.stringify(command), "*");

    }

}
175 Okunma | 2.08.2023 13:53

YORUMLAR

Yorum Yaz
Hüseyin ÖZKAN Yazılım Uzmanı

C#,MVC,MSSQL,Windows Forms