diff --git a/web/src/js/modules/content.js b/web/src/js/modules/content.js index ed44855f..a9d25e3e 100644 --- a/web/src/js/modules/content.js +++ b/web/src/js/modules/content.js @@ -24,27 +24,28 @@ function getVideoPopup($videoEl){ } $(document).ready(function () { - $('.js-video').each(async function (){ + $('.js-video').each(function (){ const $iframe = $(this); if($iframe.data('isYoutube')){ } if($iframe.data('isVimeo')){ - await loadScript('https://player.vimeo.com/api/player.js'); - const player = new Vimeo.Player(this); - player.on('pause', function(data) { - if(data.percent == 1){ - getVideoPopup($iframe).show().animate({opacity: 1}, 200); - if (document.fullscreenElement){ - document.exitFullscreen(); + loadScript('https://player.vimeo.com/api/player.js').then(() => { + const player = new Vimeo.Player(this); + player.on('pause', function(data) { + if(data.percent == 1){ + getVideoPopup($iframe).show().animate({opacity: 1}, 200); + if (document.fullscreenElement){ + document.exitFullscreen(); + } } - } - }); - player.on('play', function() { - const $p = getVideoPopup($iframe); - if($p.is(':visible')){ - $p.animate({opacity: 0}, 800).then(() => {$p.hide();}); - } + }); + player.on('play', function() { + const $p = getVideoPopup($iframe); + if($p.is(':visible')){ + $p.animate({opacity: 0}, 800).then(() => {$p.hide();}); + } + }); }); } });