Bug 1189204 - activate autoplay when playing a media source. r=jya.

This commit is contained in:
JW Wang
2015-08-04 11:17:03 +08:00
parent 9d6e7e8316
commit b410dda30d

View File

@@ -3728,12 +3728,14 @@ bool HTMLMediaElement::CanActivateAutoplay()
{
// For stream inputs, we activate autoplay on HAVE_NOTHING because
// this element itself might be blocking the stream from making progress by
// being paused.
// being paused. We also activate autopaly when playing a media source since
// the data download is controlled by the script and there is no way to
// evaluate MediaDecoder::CanPlayThrough().
return !mPausedForInactiveDocumentOrChannel &&
mAutoplaying &&
mPaused &&
((mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) ||
mSrcStream) &&
mSrcStream || mMediaSource) &&
HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) &&
mAutoplayEnabled &&
!IsEditable();