Bug 1367868 - Don't hide media controls when error occurred for audio even if it hasn't been played yet. r=jaws
Unlike video element, audio has no status overlay to inform users if an
error occurred. Instead of hiding entire media controls, we should keep
it visible in order not confuse users, and see if we can come up with a
better approach such as making the buttons disabled afterwards.
MozReview-Commit-ID: 8YSCxbWwg2O
new file mode 100644
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-with-bogus-url-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio controls></audio>
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-with-bogus-url.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio src="bogus.mp3" controls></audio>
+</body>
+</html>
+
--- a/toolkit/content/tests/reftests/reftest.list
+++ b/toolkit/content/tests/reftests/reftest.list
@@ -1,3 +1,4 @@
random-if(cocoaWidget||(/^Windows\x20NT\x206\.2/.test(http.oscpu)&&isDebugBuild)) == bug-442419-progressmeter-max.xul bug-442419-progressmeter-max-ref.xul # fails most of the time on Mac because progress meter animates
!= textbox-multiline-default-value.xul textbox-multiline-empty.xul
fails-if(styloVsGecko) == videocontrols-dynamically-add-cc.html videocontrols-dynamically-add-cc-ref.html
+fails-if(styloVsGecko) == audio-with-bogus-url.html audio-with-bogus-url-ref.html
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -672,17 +672,17 @@
// any of the child elements for playback during resource selection.
if (this.hasError()) {
this.suppressError = false;
this.clickToPlay.hidden = true;
this.statusIcon.setAttribute("type", "error");
this.updateErrorText();
this.setupStatusFader(true);
// If video hasn't shown anything yet, disable the controls.
- if (!this.firstFrameShown) {
+ if (!this.firstFrameShown && !this.isAudioOnly) {
this.startFadeOut(this.controlBar);
}
this.controlsSpacer.removeAttribute("hideCursor");
}
break;
case "mozvideoonlyseekbegin":
this._delayShowThrobberWhileResumingVideoDecoder();
break;