diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 4b326dd36ea0..d6d8ce3bf143 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -242,6 +242,7 @@ support-files = file_webaudioLoop.html file_webaudioLoop2.html file_pluginAudio.html + noaudio.webm referrer_helper.js referrer_testserver.sjs script_postmessages_fileList.js @@ -299,6 +300,7 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e1 [test_named_frames.html] [test_navigator_resolve_identity.html] [test_navigator_language.html] +[test_noAudioNotification.html] [test_noAudioNotificationOnMutedElement.html] [test_noAudioNotificationOnMutedOrVolume0Element.html] [test_noAudioNotificationOnVolume0Element.html] diff --git a/dom/base/test/noaudio.webm b/dom/base/test/noaudio.webm new file mode 100644 index 000000000000..9207017fb60e Binary files /dev/null and b/dom/base/test/noaudio.webm differ diff --git a/dom/base/test/test_noAudioNotification.html b/dom/base/test/test_noAudioNotification.html new file mode 100644 index 000000000000..fdb8487e104d --- /dev/null +++ b/dom/base/test/test_noAudioNotification.html @@ -0,0 +1,81 @@ + + + + Test for video controller in windows + + + + +
+
+ + + + + diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 0d82aa469b37..5008e601085a 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -4509,6 +4509,11 @@ void HTMLMediaElement::UpdateAudioChannelPlayingState() void HTMLMediaElement::NotifyAudioChannelAgent(bool aPlaying) { + // Don't do anything if this element doesn't have any audio tracks. + if (!HasAudio()) { + return; + } + // Immediately check if this should go to the MSG instead of the normal // media playback route. WindowAudioCaptureChanged();