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
This commit is contained in:
Alastor Wu
2019-02-21 22:52:57 +00:00
parent 6ac4e9955c
commit b53039f1ad

View File

@@ -3638,7 +3638,6 @@ already_AddRefed<Promise> HTMLMediaElement::Play(ErrorResult& aRv) {
if (AudioChannelAgentBlockedPlay()) {
LOG(LogLevel::Debug, ("%p play blocked by AudioChannelAgent.", this));
promise->MaybeReject(NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR);
DispatchEventsWhenPlayWasNotAllowed();
return promise.forget();
}