From 621b6f36b69aa22005b828f96f4a2413bc9ee519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Thu, 30 Apr 2015 23:53:12 +0200 Subject: [PATCH] Fixed mute and volume bug --- php/footer.php | 4 ++-- static/js/playercontrols.js | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/php/footer.php b/php/footer.php index 9a0f0624..304a7061 100755 --- a/php/footer.php +++ b/php/footer.php @@ -21,7 +21,7 @@ -

+

@@ -68,7 +68,7 @@ - + diff --git a/static/js/playercontrols.js b/static/js/playercontrols.js index 88b4c059..f7c2f1c8 100755 --- a/static/js/playercontrols.js +++ b/static/js/playercontrols.js @@ -1,3 +1,5 @@ +var muted = false; + function initYoutubeControls(player) { fitToScreen(); @@ -87,8 +89,17 @@ function changeQuality(wantedQ) function mute_video() { - choose_button(0, true); - ytplayer.mute(); + if(!muted) + { + choose_button(0, true); + ytplayer.mute(); + muted = true; + }else + { + ytplayer.unMute(); + muted = false; + choose_button(ytplayer.getVolume(), false); + } } function setVolume(vol)