Bug 1288971 - notify audio playback changed by media element's play().
Notify audible-changing when resuming audio by MediaElement::play() instead of control interface.
MozReview-Commit-ID: 10a1npQ46Th
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5429,19 +5429,16 @@ HTMLMediaElement::WindowSuspendChanged(S
Pause();
break;
default:
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
("HTMLMediaElement, WindowSuspendChanged, this = %p, "
"Error : unknown suspended type!\n", this));
}
- NotifyAudioPlaybackChanged(
- AudioChannelService::AudibleChangedReasons::ePauseStateChanged);
-
return NS_OK;
}
void
HTMLMediaElement::ResumeFromAudioChannel()
{
if (!IsSuspendedByAudioChannel()) {
return;
@@ -5516,16 +5513,19 @@ HTMLMediaElement::SetAudioChannelSuspend
if (mAudioChannelSuspended == aSuspend) {
return;
}
mAudioChannelSuspended = aSuspend;
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
("HTMLMediaElement, SetAudioChannelSuspended, this = %p, "
"aSuspend = %d\n", this, aSuspend));
+
+ NotifyAudioPlaybackChanged(
+ AudioChannelService::AudibleChangedReasons::ePauseStateChanged);
}
bool
HTMLMediaElement::IsSuspendedByAudioChannel() const
{
return (mAudioChannelSuspended == nsISuspendedTypes::SUSPENDED_PAUSE ||
mAudioChannelSuspended == nsISuspendedTypes::SUSPENDED_PAUSE_DISPOSABLE ||
mAudioChannelSuspended == nsISuspendedTypes::SUSPENDED_BLOCK);