From e719b6d2191530316b35e59935293fe1ab3bf312 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 23 Dec 2011 05:19:02 +0000 Subject: [PATCH] fix bugs in video player --- source/Ox.UI/js/Video/Ox.VideoPlayer.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index c1638b00..fd65181f 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -795,7 +795,7 @@ Ox.VideoPlayer = function(options, self) { self.$volumeButton = Ox.Button({ style: 'symbol', - title: 'mute', + title: getVolumeImage(), tooltip: 'Volume', type: 'image' }) @@ -1000,7 +1000,9 @@ Ox.VideoPlayer = function(options, self) { } } - self.options.fullscreen ? setSizes(enterFullscreen) : setSizes(); + setSizes(false, function() { + self.options.fullscreen && enterFullscreen(); + }); function censor() { if (self.options.type == 'play') { @@ -1399,7 +1401,7 @@ Ox.VideoPlayer = function(options, self) { }; } - function getVolumeImageURL() { + function getVolumeImage() { var symbol; if (self.options.muted || self.options.volume == 0) { symbol = 'Unmute'; @@ -1410,7 +1412,7 @@ Ox.VideoPlayer = function(options, self) { } else { symbol = 'Mute'; } - return Ox.UI.getImageURL('symbol' + symbol); + return symbol; } function goToNextClip(direction) { @@ -1875,8 +1877,7 @@ Ox.VideoPlayer = function(options, self) { } } - function setSizes(callback) { - var animate = !!callback; + function setSizes(animate, callback) { self.width = self.options.fullscreen ? window.innerWidth : self.options.width; self.height = self.options.fullscreen ? window.innerHeight : self.options.height; self.videoCSS = getVideoCSS(); @@ -1975,8 +1976,8 @@ Ox.VideoPlayer = function(options, self) { if (!!self.options.volume == self.options.muted) { toggleMuted(); } else { - self.$volumeButton.attr({ - src: getVolumeImageURL() + self.$volumeButton.options({ + title: getVolumeImage() }); self.$volumeValue.html( self.options.muted ? 0 : Math.round(self.options.volume * 100) @@ -2123,7 +2124,7 @@ Ox.VideoPlayer = function(options, self) { zIndex: 1000 }) .appendTo(Ox.UI.$body); - setSizes(function() { + setSizes(true, function() { playOnFullscreen && self.$video.play(); enterFullscreen(); }); @@ -2136,7 +2137,7 @@ Ox.VideoPlayer = function(options, self) { .unbind('mouseenter') .unbind('mouseleave'); clearTimeout(self.interfaceTimeout); - setSizes(function() { + setSizes(true, function() { self.exitFullscreen = false; that.detach() .removeClass('OxFullscreen') @@ -2170,8 +2171,8 @@ Ox.VideoPlayer = function(options, self) { if (self.$muteButton && from != 'button') { self.$muteButton.toggle(); } - self.$volumeButton && self.$volumeButton.attr({ - src: getVolumeImageURL() + self.$volumeButton && self.$volumeButton.options({ + title: getVolumeImage() }); self.$volumeInput && self.$volumeInput.value( self.options.muted ? 0 : self.options.volume