Bug 1382303 - P2. Do not activate autoplay early. r?jwwang draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 20 Jul 2017 19:11:44 +0200
changeset 613110 96a9730dbdbec784c7cd5a6be2dc479355d3f7ba
parent 613109 ace5e429ee6595adca41fa3837614fdd96639653
child 613111 29f012f3667f0ff4ec0d5ab0589e31cbc260d767
push id69735
push userbmo:jyavenard@mozilla.com
push dateFri, 21 Jul 2017 16:41:57 +0000
reviewersjwwang
bugs1382303
milestone56.0a1
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;