Bug 1645668 - part1 : reset audible state when aborting current load. r=bryce, a=RyanVM
authoralwu <alwu@mozilla.com>
Tue, 30 Jun 2020 16:50:35 +0000
changeset 601880 f00bb12f9f8e08865feedf7bb6d26d6f52c6ebb0
parent 601879 5c5346fad87a0965d4dab079bc759a24c1194315
child 601881 ecf6eea8a56f522e84c0022feb209e896b2cd0bf
push id13337
push userryanvm@gmail.com
push dateWed, 01 Jul 2020 18:37:50 +0000
treeherdermozilla-beta@ecf6eea8a56f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce, RyanVM
bugs1645668
milestone79.0
Bug 1645668 - part1 : reset audible state when aborting current load. r=bryce, a=RyanVM When aborting the current load, media element is undoubtedly inaudible. Therefore, we should reset its audible state in order to keep the audible state correct. That can help us show the sound indicator on the tab bar correctly. Differential Revision: https://phabricator.services.mozilla.com/D81631
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2240,16 +2240,17 @@ void HTMLMediaElement::AbortExistingLoad
   mSuspendedForPreloadNone = false;
   mDownloadSuspendedByCache = false;
   mMediaInfo = MediaInfo();
   mIsEncrypted = false;
   mPendingEncryptedInitData.Reset();
   mWaitingForKey = NOT_WAITING_FOR_KEY;
   mSourcePointer = nullptr;
   mIsBlessed = false;
+  SetAudibleState(false);
 
   mTags = nullptr;
   mAudioTrackSilenceStartedTime = 0.0;
 
   if (mNetworkState != NETWORK_EMPTY) {
     NS_ASSERTION(!mDecoder && !mSrcStream,
                  "How did someone setup a new stream/decoder already?");
     // ChangeNetworkState() will call UpdateAudioChannelPlayingState()