Bug 1652460 - part1 : always store the audible state change. r=bryce
Whenever the audible state changes, we should always store the latest state but only notify the change after playing starts. Differential Revision: https://phabricator.services.mozilla.com/D83549
This commit is contained in:
@@ -1533,17 +1533,20 @@ class HTMLMediaElement::AudioChannelAgentCallback final
|
||||
|
||||
void NotifyAudioPlaybackChanged(AudibleChangedReasons aReason) {
|
||||
MOZ_ASSERT(!mIsShutDown);
|
||||
if (!IsPlayingStarted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AudibleState newAudibleState = IsOwnerAudible();
|
||||
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
|
||||
("HTMLMediaElement::AudioChannelAgentCallback, "
|
||||
"NotifyAudioPlaybackChanged, this=%p, current=%s, new=%s",
|
||||
this, AudibleStateToStr(mIsOwnerAudible),
|
||||
AudibleStateToStr(newAudibleState)));
|
||||
if (mIsOwnerAudible == newAudibleState) {
|
||||
return;
|
||||
}
|
||||
|
||||
mIsOwnerAudible = newAudibleState;
|
||||
mAudioChannelAgent->NotifyStartedAudible(mIsOwnerAudible, aReason);
|
||||
if (IsPlayingStarted()) {
|
||||
mAudioChannelAgent->NotifyStartedAudible(mIsOwnerAudible, aReason);
|
||||
}
|
||||
}
|
||||
|
||||
void Shutdown() {
|
||||
|
||||
Reference in New Issue
Block a user