From 75af0402fd6cffcf28016068406dfaad20b2ce9c Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Fri, 23 Sep 2011 12:43:03 -0700 Subject: [PATCH] Bug 462117 - Reducing the number of visible controls when the video is too small. r=dolske --- toolkit/content/widgets/videocontrols.css | 15 +++++++ toolkit/content/widgets/videocontrols.xml | 48 ++++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/toolkit/content/widgets/videocontrols.css b/toolkit/content/widgets/videocontrols.css index b3ef938fb82..3be9c0dfb26 100644 --- a/toolkit/content/widgets/videocontrols.css +++ b/toolkit/content/widgets/videocontrols.css @@ -53,3 +53,18 @@ .statusOverlay[fadeout] { opacity: 0; } + +.controlBar[size="hidden"], +.controlBar[size="small"] .durationBox, +.controlBar[size="small"] .durationLabel, +.controlBar[size="small"] .positionLabel { + visibility: collapse; +} + +.controlBar[size="small"] .scrubberStack { + visibility: hidden; +} + +.controlBar[size="small"] .scrubberStack > * { + visibility: hidden; +} diff --git a/toolkit/content/widgets/videocontrols.xml b/toolkit/content/widgets/videocontrols.xml index cbbb04ce169..cf595c4d0b8 100644 --- a/toolkit/content/widgets/videocontrols.xml +++ b/toolkit/content/widgets/videocontrols.xml @@ -343,6 +343,17 @@ this.statusIcon.setAttribute("type", "throbber"); this.setupStatusFader(); } + + // An event handler for |onresize| should be added when bug 227495 is fixed. + let controlBarWasHidden = this.controlBar.getAttribute("hidden") == "true"; + this.controlBar.removeAttribute("hidden"); + this._playButtonWidth = this.playButton.clientWidth; + this._durationLabelWidth = this.durationLabel.clientWidth; + this._muteButtonWidth = this.muteButton.clientWidth; + this._controlBarHeight = this.controlBar.clientHeight; + if (controlBarWasHidden) + this.controlBar.setAttribute("hidden", "true"); + this.adjustControlSize(); }, get dynamicControls() { @@ -400,6 +411,7 @@ this.volumeControl.value = volume; break; case "loadedmetadata": + this.adjustControlSize(); // If a