Bug 1242874 - part4 : wrap the volume/mute/suspend for notifyStartedPlaying. r=baku

MozReview-Commit-ID: 2FMfEVuODmu
This commit is contained in:
Alastor Wu
2016-05-03 09:52:44 +08:00
parent 5704a47317
commit 7b158c5b32
8 changed files with 71 additions and 49 deletions

View File

@@ -5061,10 +5061,14 @@ HTMLMediaElement::NotifyAudioChannelAgent(bool aPlaying)
AutoNoJSAPI nojsapi;
if (aPlaying) {
float volume = 0.0;
bool muted = true;
mAudioChannelAgent->NotifyStartedPlaying(&volume, &muted);
WindowVolumeChanged(volume, muted);
AudioPlaybackConfig config;
nsresult rv = mAudioChannelAgent->NotifyStartedPlaying(&config);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
WindowVolumeChanged(config.mVolume, config.mMuted);
WindowSuspendChanged(config.mSuspend);
} else {
mAudioChannelAgent->NotifyStoppedPlaying();
mAudioChannelAgent = nullptr;