From fa0758cb8afae4bcb95a62f732a5a9fcaf2d17b3 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Thu, 27 Jul 2017 19:01:23 +0200 Subject: [PATCH] =?UTF-8?q?Restauration=20son=20vid=C3=A9o=20fermeture=20f?= =?UTF-8?q?enetre=20modale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index c497667..ac24ccb 100644 --- a/index.html +++ b/index.html @@ -276,6 +276,8 @@ } var comment_header = "

" + + var prev_video_mute = true; $('#iframeModal').on('show.bs.modal', function (event) { var modal = $(this); @@ -293,7 +295,10 @@ if (youtube_id) { - masthead_video_mute(true); + if (!masthead_video.muted) { + prev_video_mute = false; + masthead_video_mute(true); + } url = 'https://www.youtube.com/embed/' + youtube_id + "?modestbranding=1&rel=0&html5=1"; @@ -306,7 +311,10 @@ } else if (vimeo_id) { - masthead_video_mute(true); + if (!masthead_video.muted) { + prev_video_mute = false; + masthead_video_mute(true); + } url = 'https://player.vimeo.com/video/' + vimeo_id; @@ -332,6 +340,10 @@ $('#iframeModal').on('hidden.bs.modal', function () { $(this).find('.modal-body iframe')[0].src = ""; $(this).find('.modal-body .modal-comment')[0].innerHTML = ""; + + if (!prev_video_mute) { + masthead_video_mute(false); + } });