Bug 595009 - Ensure video controls don't show when we can't load a resource. r=dolske a=blocking2.0
authorChris Pearce <chris@pearce.org.nz>
Thu, 18 Nov 2010 08:27:19 +1300
changeset 57652 2bd86fdd9c622611e1691e6bc3cb012a0dc39e5a
parent 57651 8f35051eed78f69d0912afb61cecc5904d9f2306
child 57653 0281473dbd79e0e01e52f130e96b790a0b60d416
push id17025
push usercpearce@mozilla.com
push dateWed, 17 Nov 2010 19:44:29 +0000
treeherdermozilla-central@2bd86fdd9c62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, blocking2.0
bugs595009
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 595009 - Ensure video controls don't show when we can't load a resource. r=dolske a=blocking2.0
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -373,17 +373,17 @@
                     // and we'll figure out the exact state then.)
                     this.bufferBar.setAttribute("max", 100);
                     if (this.video.readyState >= this.video.HAVE_METADATA)
                         this.showBuffered();
                     else
                         this.bufferBar.setAttribute("value", 0);
 
                     // Set the current status icon.
-                    if (this.video.error) {
+                    if (this.video.error || this.video.networkState == this.video.NETWORK_NO_SOURCE) {
                         this.statusIcon.setAttribute("type", "error");
                         this.setupStatusFader(true);
                     } else {
                         this.statusIcon.setAttribute("type", "throbber");
                         this.setupStatusFader();
                     }
                 },
 
@@ -392,17 +392,17 @@
                     var enabled = !this.isAudioOnly;
 
                     // Allow tests to explicitly suppress the fading of controls.
                     if (this.video.hasAttribute("mozNoDynamicControls"))
                         enabled = false;
 
                     // If the video hits an error, suppress controls if it
                     // hasn't managed to do anything else yet.
-                    if (!this.firstFrameShown && this.video.error)
+                    if (!this.firstFrameShown && (this.video.error || this.video.networkState == this.video.NETWORK_NO_SOURCE))
                         enabled = false;
 
                     return enabled;
                 },
                 
                 handleEvent : function (aEvent) {
                     this.log("Got media event ----> " + aEvent.type);