Confirmed users
381
edits
| (16 intermediate revisions by 6 users not shown) | |||
| Line 20: | Line 20: | ||
* ''publicnotification'': Forced camera shutter sounds. '''This will not be in V1'''. | * ''publicnotification'': Forced camera shutter sounds. '''This will not be in V1'''. | ||
Whenever an audio channel is used, | Whenever an audio channel is used, lower priority channels are automatically paused. The only exception to this is that "normal" and "content" has the same priority which means that if the "content" channel is used, it's simply mixed with audio from the "normal" channel. | ||
If two apps try to use the "content" channel at the same time, the foreground app wins. If both of the apps are background apps, then the last app to try to use the channel wins. | If two apps try to use the "content" channel at the same time, the foreground app wins. If both of the apps are background apps, then the last app to try to use the channel wins. | ||
| Line 44: | Line 44: | ||
} | } | ||
We'll additionally introduce a new attribute " | We'll additionally introduce a new attribute "mozAudioChannelType" on <audio> and <video> which selects which audio channel will be used for any played audio. | ||
partial interface HTMLMediaElement { | partial interface HTMLMediaElement { | ||
| Line 121: | Line 121: | ||
I'm not sure if we need to have prompts if non-privileged apps try to use channels beyond the "normal" or "content" channels. | I'm not sure if we need to have prompts if non-privileged apps try to use channels beyond the "normal" or "content" channels. | ||
== Audio Competing Policy == | |||
<table border="1" cellspacing="0" cellpadding="3" align="center"> | |||
<tr> | |||
<th>AudioChannelType | |||
<th>Priority | |||
<th>Foreground | |||
<th>Background | |||
<th>Timing of Resuming | |||
<th>Faded Effect | |||
<tr> | |||
<td>normal | |||
<td>0 | |||
<td>Play | |||
<td>[1] | |||
<td>Transit to foreground. | |||
<td>If notification is fired, volume will be reduced to 20% of current level. | |||
<tr> | |||
<td>content | |||
<td>1 | |||
<td>Play | |||
<td>[1], [2] | |||
<td valign="middle" align="left"> | |||
If the muted/paused is caused by | |||
1. [1] then will be resumed when [3]. | |||
2. [2] then will be resumed to play when transit to foreground. | |||
<td>As above. | |||
<tr> | |||
<td>notification | |||
<td>2 | |||
<td>Play | |||
<td>[1] | |||
<td>[3] | |||
<td>N/A | |||
<tr> | |||
<td>alarm | |||
<td>3 | |||
<td>Play | |||
<td>[1] | |||
<td>[3] | |||
<td>N/A | |||
<tr> | |||
<td>telephony | |||
<td>4 | |||
<td>Play | |||
<td>[1] | |||
<td>[3] | |||
<td>N/A | |||
<tr> | |||
<td>ringer | |||
<td>5 | |||
<td>Play | |||
<td>[1] | |||
<td>[3] | |||
<td>N/A | |||
<tr> | |||
<td>public notification | |||
<td>6 | |||
<td>Play | |||
<td>Play | |||
<td>N/A | |||
<td>N/A | |||
</table> | |||
[1] If there is any higher priority channel in playing then muted or paused. | |||
[2] If there is any other content channel starting to play in foreground or background then current content channel in playing will be muted or paused. | |||
[3] No higher priority channels are in playing. | |||
== Use cases and requirements == | == Use cases and requirements == | ||
| Line 154: | Line 236: | ||
* User lowers volume to a very low volume, this likely either affects content or ringer volume. Suddenly there's an incoming notification. However since this is a separate volume this can be very loud which is surprising to the user. | * User lowers volume to a very low volume, this likely either affects content or ringer volume. Suddenly there's an incoming notification. However since this is a separate volume this can be very loud which is surprising to the user. | ||
* User enters dialer and lowers volume. Then presses DTMF tone buttons and expects this to play at a low volume. | * User enters dialer and lowers volume. Then presses DTMF tone buttons and expects this to play at a low volume. | ||
=== Refactor Audio Channel Service === | |||
(04/30/2015 updated) | |||
* Gecko: The concept of refactoring the audio channel service is to deal with those issues that we couldn't solve by the existing mechanism in gecko, and we will need the changes(in below) in both gecko and gaia to have a new management. | |||
** '''New browser api''': {{Bug|1113086}} - this is the major part for the new browser api so that the gaia system app is able to control each iframe/app's audio channel, such as allowing or denying those types we have in b2g. | |||
*** It's almost completed, just lacking of the volume control of the FM Radio. | |||
** '''Telephony''': {{Bug|1129882}} - The new audio channel browser api will be implemented base on the foundation of media element, but the telephony api does not use media element to produce sound, so we need the telephony api to bind on a specific window(callscreen), just like the other apps did. | |||
*** Review finish, wait for landing. | |||
** '''VOIP''': {{Bug|1126224}} - There will be 3rd party apps that use webrtc api to implement voip services, and to fit the ux spec, these apps might behave different from the gaia callscreen app, so probably we will need a new type called "voip" to distinguish from "telephony" and "voip" audio channels. | |||
*** This issue is paused now, since we have no the consensus about whether we really need the "voip" type. | |||
** '''System''': {{Bug|1142933}} - The ux spec has specified a new audio channel type called "system" to represent those sounds that system use, such as the keyboard, screen lock or screenshot... | |||
*** Review finish, wait for landing. | |||
* Gaia: The system app will use the browser api({{Bug|1113086}}) to control all the audio channels in gaia, it means we will move the audio channel service from gecko to gaia, since gaia has more window related information then gecko and can do a better management. | |||
** '''Audio Channel Manager''': {{Bug|1100822}} - we will introduce this new module in system app, to manage the audio channels. | |||
*** Landed. | |||
** '''System''': {{Bug|1157140}} - Manage System app's audio channels in the AudioChannelManager. | |||
*** Figuring out a good way to manage the audio channels in System app. | |||
** '''Callscreen''': {{Bug|1159610}} - The Callscreen app needs to call the telephony's audio channel api. | |||
** '''Cleanup''': {{Bug|1139838}} - Remove all the hacks for audio channel. | |||
* UX: Before the refactoring started, developers and ux had meetings to discuss about the current audio issues and future needs, then came out a sound spec to define the audio channel behaviours. | |||
** '''Spec''': {{Bug|1068219}} - as the developers are implementing the new modules, meanwhile ux is also updating the spec if we encounter some problems on the behaviours or coding limitation. | |||
[[Category:Web APIs]] | |||