Bug 1371202. P1 - plumb the 'loop' attribute into MDSM. r=jya

MozReview-Commit-ID: DtsaXmtQw76
This commit is contained in:
JW Wang
2017-06-08 12:03:10 +08:00
parent 0898c6ca13
commit e11983b26f
5 changed files with 36 additions and 4 deletions

View File

@@ -2473,7 +2473,8 @@ nsresult HTMLMediaElement::LoadResource()
mPreservesPitch,
mPlaybackRate,
mPreloadAction == HTMLMediaElement::PRELOAD_METADATA,
mHasSuspendTaint);
mHasSuspendTaint,
HasAttr(kNameSpaceID_None, nsGkAtoms::loop));
RefPtr<MediaSourceDecoder> decoder = new MediaSourceDecoder(decoderInit);
if (!mMediaSource->Attach(decoder)) {
@@ -4234,6 +4235,10 @@ HTMLMediaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
}
} else if (aName == nsGkAtoms::preload) {
UpdatePreloadAction();
} else if (aName == nsGkAtoms::loop) {
if (mDecoder) {
mDecoder->SetLooping(!!aValue);
}
}
}
@@ -4607,7 +4612,8 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal)
mPreservesPitch,
mPlaybackRate,
mPreloadAction == HTMLMediaElement::PRELOAD_METADATA,
mHasSuspendTaint);
mHasSuspendTaint,
HasAttr(kNameSpaceID_None, nsGkAtoms::loop));
RefPtr<MediaDecoder> decoder = aOriginal->Clone(decoderInit);
if (!decoder)
@@ -4645,7 +4651,8 @@ nsresult HTMLMediaElement::InitializeDecoderForChannel(nsIChannel* aChannel,
mPreservesPitch,
mPlaybackRate,
mPreloadAction == HTMLMediaElement::PRELOAD_METADATA,
mHasSuspendTaint);
mHasSuspendTaint,
HasAttr(kNameSpaceID_None, nsGkAtoms::loop));
RefPtr<MediaDecoder> decoder =
DecoderTraits::CreateDecoder(mimeType, decoderInit, &diagnostics);