Bug 1382303 - P2. Do not activate autoplay early. r=jwwang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 20 Jul 2017 19:11:44 +0200
changeset 418944 0c6a7835fef4b3d290de4db04a0fd3322b5ba1dc
parent 418943 6568f892a5c4c0f89b40d8a051f204100740da56
child 418945 5e11375d63c751dca3e5853614bd770f9c5b0f57
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1382303
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1382303 - P2. Do not activate autoplay early. r=jwwang Per spec, autoplay should only gets triggered once readyState is equal to HAVE_ENOUGH_DATA MozReview-Commit-ID: 6nW1U6G1qme
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5981,18 +5981,17 @@ bool HTMLMediaElement::CanActivateAutopl
         mAudioChannelWrapper->GetSuspendType() == nsISuspendedTypes::SUSPENDED_BLOCK ||
         mAudioChannelWrapper->IsPlaybackBlocked()) {
       return false;
     }
   }
 
   bool hasData =
     (mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) ||
-    (mSrcStream && mSrcStream->Active()) ||
-    mMediaSource;
+    (mSrcStream && mSrcStream->Active());
 
   return hasData;
 }
 
 void HTMLMediaElement::CheckAutoplayDataReady()
 {
   if (!CanActivateAutoplay()) {
     return;