Bug 879717: Part 2 - Avoid having autoplaying stream-backed HTMLMediaElements block indefinitely. r=roc

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

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

@ -3279,14 +3279,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();