Bug 1201969 - pause element only when start playing. r=baku

This commit is contained in:
Alastor Wu
2015-09-09 10:41:33 +08:00
parent 351e7ad8a6
commit ac97832fee

View File

@@ -4075,7 +4075,13 @@ HTMLMediaElement::NotifyOwnerDocumentActivityChangedInternal()
bool pauseElement = !IsActive();
#ifdef PAUSE_MEDIA_ELEMENT_FROM_AUDIOCHANNEL
pauseElement |= ComputedMuted();
// Only pause the element when we start playing. If we pause without playing
// audio, the resource loading would be affected unexpectedly. For example,
// the media element is muted by default, but we don't want this behavior
// interrupting the loading process.
if (mAudioChannelAgent) {
pauseElement |= ComputedMuted();
}
#endif
SuspendOrResumeElement(pauseElement, !IsActive());