mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 10:15:41 +00:00
Bug 1192818 - part2 : only dispatch DOMAudioPlaybackStarted when there is audible sound. r=baku
The DOMAudioPlaybackStarted event would affect the tabbrowser's attribute, "soundPlaying", and this attribute should indicate whether the tab is audible or not. However, in present codebase, even the tab has "soundplaying", it doens't mean the tab has audible sound, you need to check extra attribute, "muted". After applying this patch, tabbrowser can only own one of the attributes ("soundplaying" or "mute"). These attributes won't exist at the same time, so we can easily know whether the tab is audible by checking "soundPlaying". Let's see an example, step1. playing a playing audio - tab owns "soundPlaying" step2. mute the tab - tab owns "muted" step3. stop audio - tab owns "muted" step4. replay the audio - tab owns "muted" step5. unmute the tab - tab owns "soundPlaying" step6. stop audio - tab owns "" MozReview-Commit-ID: 50NorRbRIP --HG-- extra : rebase_source : 8a06d1df7f4e3b974b18292944b19ada20eb655d
This commit is contained in:
parent
c5d7911229
commit
f2ea075d35
@ -698,6 +698,9 @@
|
||||
<method name="audioPlaybackStarted">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._audioMuted) {
|
||||
return;
|
||||
}
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("DOMAudioPlaybackStarted", true, false);
|
||||
this.dispatchEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user