Bug 1302084 - the error checking should have highest priority. draft
authorAlastor Wu <alwu@mozilla.com>
Thu, 06 Oct 2016 12:07:33 +0800
changeset 421439 7557842b7d9eb508be106e98dff33420fdf16ba9
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 533080 360457ac6afafa1cd8de8c20f9b78bb9c75c41b0
push id31501
push useralwu@mozilla.com
push dateThu, 06 Oct 2016 04:08:02 +0000
bugs1302084
milestone52.0a1
Bug 1302084 - the error checking should have highest priority. MozReview-Commit-ID: 9QC5CG7p28M
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5734,31 +5734,31 @@ HTMLMediaElement::MaybeCreateAudioChanne
                                              this);
   }
   return true;
 }
 
 bool
 HTMLMediaElement::IsPlayingThroughTheAudioChannel() const
 {
+  // If we have an error, we are not playing.
+  if (mError) {
+    return false;
+  }
+
   // It might be resumed from remote, we should keep the audio channel agent.
   if (IsSuspendedByAudioChannel()) {
     return true;
   }
 
   // Are we paused
   if (mPaused) {
     return false;
   }
 
-  // If we have an error, we are not playing.
-  if (mError) {
-    return false;
-  }
-
   // We should consider any bfcached page or inactive document as non-playing.
   if (!IsActive()) {
     return false;
   }
 
   // A loop always is playing
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::loop)) {
     return true;