Как добавить video в ZeroPopUP в Tilda
Zero #Video1

Как добавить video в ZeroPopUP в Tilda

1
Создали ZeroPopUP (https://mo-ti.ru/popupzero)
2
Добавили в этот Zero элемент HTML
Вставили в него 1-ый код - плеера
3
2-ой код добавили на страницу, в блок Другое - Т123
Указали в нём ссылку кнопки, которая вызывает popUP
(в примере #popupzero:subscribe)

Библиотека для примера

<iframe class="zerovid" width="100%" height="100%" src="https://www.youtube.com/embed/ZQKdayVotaI?enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<script>
let observer = new MutationObserver(function (mutations) {
    mutations.forEach(function (mutation) {
        let newVal = $(mutation.target).prop(mutation.attributeName);
        if (mutation.attributeName === "class") {
        	if(!$(".t390 .t-popup").hasClass("t-popup_show")) {
                $("iframe")[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
      	    };   
        };
    });
});
observer.observe( document.body, {  attributes: true});
$(document).on('click', 'a[href^="#popup"]', function() {
    let popUpLik = $(this).attr('href');
    let videoiIn = $('.t390 .t-popup[data-tooltip-hook="'+popUpLik+'"] iframe.zerovid').length;
    if(videoiIn){
        $('.t390 .t-popup[data-tooltip-hook="'+popUpLik+'"] iframe.zerovid')[0].contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');    
    };
  });
</script>
Made on
Tilda