From d152c4b48bedcd5579ee09e11ffe055989bebf2d Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 5 Nov 2011 15:27:53 +0000 Subject: [PATCH] in video player, trigger muted event also if caused indirectly by setting volume to zero or turning volume up while muted --- source/Ox.UI/js/Video/Ox.VideoPlayer.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index a23fedcb..38778407 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -1893,15 +1893,16 @@ Ox.VideoPlayer = function(options, self) { function setVolume(volume) { self.options.volume = volume; if (!!self.options.volume == self.options.muted) { - self.options.muted = !self.options.muted; - self.$video.muted(self.options.muted); - self.$muteButton.toggleTitle(); + toggleMuted(); + } else { + self.$volumeButton.attr({ + src: getVolumeImageURL() + }); + self.$volumeValue.html( + self.options.muted ? 0 : Math.round(self.options.volume * 100) + ); } !self.censored && self.$video.volume(self.options.volume); - self.$volumeButton.attr({ - src: getVolumeImageURL() - }); - self.$volumeValue.html(self.options.muted ? 0 : Math.round(self.options.volume * 100)); that.triggerEvent('volume', { volume: self.options.volume });