Bug 879717 - Part 2. Avoid autoplaying stream-backed HTMLMediaElements blocking indefinitely. r=roc

This commit is contained in:
Andreas Pehrson 2014-10-03 21:38:03 +02:00
Родитель 542119cc82
Коммит eedf1ceec5
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -3286,14 +3286,14 @@ void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState)
bool HTMLMediaElement::CanActivateAutoplay()
{
// For stream inputs, we activate autoplay on HAVE_CURRENT_DATA because
// For stream inputs, we activate autoplay on HAVE_METADATA because
// this element itself might be blocking the stream from making progress by
// being paused.
return !mPausedForInactiveDocumentOrChannel &&
mAutoplaying &&
mPaused &&
((mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) ||
(mSrcStream && mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA)) &&
(mSrcStream && mReadyState >= nsIDOMHTMLMediaElement::HAVE_METADATA)) &&
HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) &&
mAutoplayEnabled &&
!IsEditable();