зеркало из https://github.com/mozilla/gecko-dev.git
Bug 879717: Part 2 - Avoid having autoplaying stream-backed HTMLMediaElements block indefinitely. r=roc
This commit is contained in:
Родитель
aeaba15e6f
Коммит
4015e76ae1
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче