Bug 1334825 - part 2: notify inner window when media element playback state changes. r?alwu
MozReview-Commit-ID: KfxUdPJHGZo
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -646,16 +646,22 @@ public:
if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) {
if (!MaybeCreateAudioChannelAgent()) {
return;
}
mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
NotifyAudioChannelAgent(mPlayingThroughTheAudioChannel);
+
+ nsPIDOMWindowInner* window = mOwner->OwnerDoc()->GetInnerWindow();
+ if (window) {
+ mPlayingThroughTheAudioChannel ? window->AddPlayingElement(mOwner)
+ : window->RemovePlayingElement(mOwner);
+ }
}
}
bool
ShouldResetSuspend() const
{
// The disposable-pause should be clear after media starts playing.
if (!mOwner->Paused() &&