Bug 1381375 - Show proper error message for 404 not found media source on video controls. r=jaws
authorRay Lin <ralin@mozilla.com>
Mon, 30 Oct 2017 13:55:08 +0800
changeset 389419 56717feaa049282d050c9760811c58cba7e06f58
parent 389418 599ec0420435a0f8e45da1fc4ab503586f1befd8
child 389420 d0bf8a7bfd3cd293430b5acb71ffe4b89463d58b
push id96855
push userarchaeopteryx@coole-files.de
push dateTue, 31 Oct 2017 23:40:37 +0000
treeherdermozilla-inbound@285362745f60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1381375
milestone58.0a1
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 1381375 - Show proper error message for 404 not found media source on video controls. r=jaws MozReview-Commit-ID: JbMGBnlhH3w
toolkit/content/tests/widgets/test_videocontrols_error.html
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/tests/widgets/test_videocontrols_error.html
+++ b/toolkit/content/tests/widgets/test_videocontrols_error.html
@@ -33,17 +33,17 @@
   }));
 
   testCases.push(() => new Promise(resolve => {
     video.src = "invalid-path.ogg";
     video.addEventListener("error", resolve);
   }));
 
   testCases.push(() => new Promise(resolve => {
-    const errorType = "errorSrcNotSupported";
+    const errorType = "errorNoSource";
 
     ok(!statusOverlay.hidden, `statusOverlay should show when ${errorType}`);
     is(statusOverlay.getAttribute("error"), errorType, `statusOverlay should have correct error state: ${errorType}`);
     is(statusIcon.getAttribute("type"), "error", `should show error icon when ${errorType}`);
 
     resolve();
   }));
 
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -761,17 +761,19 @@
               break;
             case v.error.MEDIA_ERR_NETWORK:
               error = "errorNetwork";
               break;
             case v.error.MEDIA_ERR_DECODE:
               error = "errorDecode";
               break;
             case v.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
-              error = "errorSrcNotSupported";
+              error = v.networkState == v.NETWORK_NO_SOURCE ?
+                "errorNoSource" :
+                "errorSrcNotSupported";
               break;
             default:
               error = "errorGeneric";
               break;
           }
         } else if (v.networkState == v.NETWORK_NO_SOURCE) {
           error = "errorNoSource";
         } else {