Bug 1447544 - Set firstShow to false before the control fades out r=Gijs

The flag is used to trigger play() when the control first hides.
There is no reason to set only after transition ends.  We can set it to false
as soon as we trigger play().

This is likely to fix a regression from bug 1449532 given that we have switched
to Web Animation API there.

MozReview-Commit-ID: F4n3rKdzYKr

--HG--
extra : rebase_source : 133fde3832c6303b87ad42e16ed397292cb98e7c
This commit is contained in:
Timothy Guan-tin Chien 2018-04-05 13:07:27 +08:00
parent 626b56fb10
commit 9bb2c92988

View File

@ -1951,20 +1951,9 @@
return;
}
this.Utils.startFadeOut(this.Utils.controlBar);
if (this.firstShow) {
this.videocontrols.addEventListener("transitionend", this);
}
},
handleEvent(aEvent) {
if (aEvent.type == "transitionend") {
this.firstShow = false;
try {
this.videocontrols.removeEventListener("transitionend", this);
} catch (ex) {}
return;
}
if (this.videocontrols.randomID != this.Utils.randomID) {
this.terminateEventListeners();
}
@ -2002,6 +1991,7 @@
if (event.originalTarget == self.Utils.controlsSpacer) {
if (self.firstShow) {
self.Utils.video.play();
self.firstShow = false;
}
self.toggleControls();
}