Bug 883731 - Per spec. autoplay activation should be handled by readyState transition. r=cpearce

This commit is contained in:
JW Wang 2014-09-29 16:53:00 +13:00
parent e25d70a688
commit 4e9f76649f

View File

@ -3070,9 +3070,6 @@ void HTMLMediaElement::SeekCompleted()
void HTMLMediaElement::NotifySuspendedByCache(bool aIsSuspended)
{
mDownloadSuspendedByCache = aIsSuspended;
// If this is an autoplay element, we may need to kick off its autoplaying
// now so we consume data and hopefully free up cache space.
CheckAutoplayDataReady();
}
void HTMLMediaElement::DownloadSuspended()
@ -3293,8 +3290,7 @@ bool HTMLMediaElement::CanActivateAutoplay()
return !mPausedForInactiveDocumentOrChannel &&
mAutoplaying &&
mPaused &&
(mDownloadSuspendedByCache ||
(mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) ||
((mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) ||
(mSrcStream && mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA)) &&
HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) &&
mAutoplayEnabled &&