Workaround for cloned videos not retaining their muted state.

This commit is contained in:
wolfbeast 2018-02-10 07:30:57 +01:00 committed by Roy Tam
commit 0a03067ee3

View file

@ -4550,6 +4550,11 @@ void HTMLMediaElement::FirstFrameLoaded()
ChangeDelayLoadStatus(false);
// FIXME: This is a workaround for DoneCreatingElement() not being called
// at the appropriate time when cloning elements, to preserve the "muted"
// status. See bug 1424871.
if (HasAttr(kNameSpaceID_None, nsGkAtoms::muted)) SetMuted(true);
if (mDecoder && mAllowSuspendAfterFirstFrame && mPaused &&
!HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) &&
mPreloadAction == HTMLMediaElement::PRELOAD_METADATA) {