WebAudio should dispatch mozinterruptbegin and mozinterruptend when AudioChannelService mutes the AudioChannelDestination node.

RESOLVED FIXED in Firefox 32

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: baku, Assigned: baku)

Tracking

Trunk
mozilla32
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox32 fixed, b2g-v2.0 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Currently HTMLMediaElement dispatches these 2 events and they are useful for ffos apps. We should do something similar in WebAudio as well.
Posted patch webaudio.patch (obsolete) — Splinter Review
Would like to write a mochitest but I don't know how to make the all document hidden. I tested it changing tabs. Any solution is welcome.
Attachment #8435145 - Flags: review?(ehsan)
Component: DOM → Web Audio
Comment on attachment 8435145 [details] [diff] [review]
webaudio.patch

Review of attachment 8435145 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/media/webaudio/AudioDestinationNode.cpp
@@ +435,5 @@
> +  SetCanPlay(playing);
> +
> +  return Context()->DispatchTrustedEvent(
> +           playing ? NS_LITERAL_STRING("mozinterruptend")
> +                   : NS_LITERAL_STRING("mozinterruptbegin"));

Nit: please keep returning NS_OK here.

::: content/media/webaudio/AudioDestinationNode.h
@@ +93,5 @@
>    SelfReference<AudioDestinationNode> mOfflineRenderingRef;
>    uint32_t mFramesToProduce;
>  
>    nsCOMPtr<nsIAudioChannelAgent> mAudioChannelAgent;
> +  bool mAudioChannelAgentPlaying;

Nit: please move this down next to the other two bools for better packing.
Attachment #8435145 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/87fc79cf3fe1
Assignee: nobody → amarchesini
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Blocks: 1016277
Comment on attachment 8435294 [details] [diff] [review]
webaudio.patch

Approval Request Comment
[Feature/regressing bug #]: bug 1016277
[User impact if declined]: multiple telephony calls can play audio at the same time.
[Describe test coverage new/current, TBPL]: fully covered.
[Risks and why]: None
[String/UUID change made/needed]: None
Attachment #8435294 - Flags: approval-mozilla-aurora?
Attachment #8435294 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
This landed on m-c prior to the uplift to Aurora (see the Target Milestone, landing date, and the link below), so what's being approved here?
https://hg.mozilla.org/releases/mozilla-aurora/rev/87fc79cf3fe1
Flags: needinfo?(sledru)
Flags: needinfo?(amarchesini)
Ryan, no needs. Thanks.
Flags: needinfo?(amarchesini)
Attachment #8435294 - Flags: approval-mozilla-aurora+
CF comment #8. Sorry. I should have checked that.
Flags: needinfo?(sledru)
You need to log in before you can comment on or make changes to this bug.