Bug 1525156 - part1 : not dispatch event when play is rejected by AudioChannelAgent. r=cpearce
authorAlastor Wu <alwu@mozilla.com>
Thu, 21 Feb 2019 22:52:57 +0000
changeset 519108 adb554a755e5c3e3c4280d6de251e470aff7223c
parent 519107 31a85e2ed53e7675272897aa1e2eec169c1adc60
child 519109 0a003a54ff4554cb8b68f3f0d54a6bd3ef166c16
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1525156
milestone67.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 1525156 - part1 : not dispatch event when play is rejected by AudioChannelAgent. r=cpearce "blocked" event is used for blocking autoplay. The `AudioChannelAgentBlockedPlay()` returns true when we lost audio focus on Android, so actually we don't need to dispatch "blocked" event. Differential Revision: https://phabricator.services.mozilla.com/D18627
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3633,17 +3633,16 @@ already_AddRefed<Promise> HTMLMediaEleme
     MaybeDoLoad();
     mPendingPlayPromises.AppendElement(promise);
     return promise.forget();
   }
 
   if (AudioChannelAgentBlockedPlay()) {
     LOG(LogLevel::Debug, ("%p play blocked by AudioChannelAgent.", this));
     promise->MaybeReject(NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR);
-    DispatchEventsWhenPlayWasNotAllowed();
     return promise.forget();
   }
 
   UpdateHadAudibleAutoplayState();
 
   const bool handlingUserInput = EventStateManager::IsHandlingUserInput();
   mPendingPlayPromises.AppendElement(promise);