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