Bug 493523 - Scrubber doesn't show the correct time if it changed while hidden. r=neil, a192=beltzner

This commit is contained in:
Justin Dolske 2009-05-20 22:27:01 -07:00
parent b922cc0075
commit 03a33c38a6

View File

@ -267,7 +267,7 @@
// controlFader holds the fade state for the control bar. // controlFader holds the fade state for the control bar.
controlFader : { controlFader : {
name : "controls", // shorthand for debugging name : "controls", // fader identifier
element : null, // the element to fade in/out element : null, // the element to fade in/out
runtime : 0, // duration of active animation runtime : 0, // duration of active animation
fadingIn : false, // are we fading in, or fading out? fadingIn : false, // are we fading in, or fading out?
@ -708,6 +708,12 @@
if (pos > 1) if (pos > 1)
pos = 1; pos = 1;
// Bug 493523, the scrubber doesn't call valueChanged while hidden,
// so our dependent state (eg, timestamp in the thumb) will be stale.
// As a workaround, update it manually when it first becomes unhidden.
if (fader.name == "controls" && fader.fadingIn && fader.element.hidden)
self.scrubber.valueChanged("curpos", self.video.currentTime * 1000, false);
// Calculate the opacity for our position in the animation. // Calculate the opacity for our position in the animation.
var opacity; var opacity;
if (fader.fadingIn) if (fader.fadingIn)