Activate autoplay when playing a media source

Bug 1189204
This commit is contained in:
trav90
2017-05-28 03:39:27 -05:00
committed by Roy Tam
parent c64c8048cd
commit 8e2879959b
+4 -2
View File
@@ -3686,12 +3686,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 autoplay 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();