From a9003418f5c23ead9879b72ada0f042018b21919 Mon Sep 17 00:00:00 2001 From: gzbender Date: Mon, 3 Jun 2019 08:45:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D0=B0=D0=BF=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=86=D0=B5=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/js/modules/content.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) 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();}); + } + }); }); } });