Bug 1339230 - part2 : should be non-audible when media is suspended. draft
authorAlastor Wu <alwu@mozilla.com>
Fri, 24 Feb 2017 17:15:22 +0800
changeset 489026 3fb3731392bb36b503412c6dcb485404f7550f73
parent 489025 a9b94043a73f2fe7e052e2bb35a2b4752a084a85
child 489027 cc1bb7da20a8b0e3b628d25f108d802567020fa3
push id46736
push useralwu@mozilla.com
push dateFri, 24 Feb 2017 09:17:40 +0000
bugs1339230
milestone54.0a1
Bug 1339230 - part2 : should be non-audible when media is suspended. MozReview-Commit-ID: GtktbXEpuUU
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1005,16 +1005,21 @@ private:
       return AudioChannelService::AudibleState::eNotAudible;
     }
 
     // Might be audible but not yet.
     if (mOwner->HasAudio() && !mOwner->mIsAudioTrackAudible) {
       return AudioChannelService::AudibleState::eMaybeAudible;
     }
 
+    // Media is suspended.
+    if (mSuspended != nsISuspendedTypes::NONE_SUSPENDED) {
+      return AudioChannelService::AudibleState::eNotAudible;
+    }
+
     return AudioChannelService::AudibleState::eAudible;
   }
 
   bool
   IsPlayingThroughTheAudioChannel() const
   {
     // If we have an error, we are not playing.
     if (mOwner->GetError()) {