<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>