WebAPI/AudioChannels: Difference between revisions

Jump to navigation Jump to search
Line 37: Line 37:
   attribute boolean telephonySpeaker; // When set to true, the "telephony" channel uses the speaker.
   attribute boolean telephonySpeaker; // When set to true, the "telephony" channel uses the speaker.
                                       // I.e. this is the same as navigator.telephony.speakerEnabled
                                       // I.e. this is the same as navigator.telephony.speakerEnabled
                                       // Might not be needed for v1 if we aren't targetting VoIP apps.
                                       // Might not be needed for v1 if we aren't targeting VoIP apps.
   
   
   attribute DOMString volumeControlChannel; // The channel whose volume is changed if the user presses the
   attribute DOMString volumeControlChannel; // The channel whose volume is changed if the user presses the
                                             // volumeup/down buttons. Defaults to "normal".
                                             // volumeup/down buttons. Defaults to "normal".
  }
  }
We'll additionally introduce a new attribute "mozchannel" on <audio> and <video> which selects which audio channel will be used for any played audio.


When muteBelow is called, it changes the mutedChannels property of all AudioChannelManager instances in all apps. Also all audio for all muted channels are muted. The audio's are not automatically paused. Instead applications are expected to listen to the "mutedchanged" event and call pause() as they see fit, for example if they want to resume music where it was when the music was muted.
When muteBelow is called, it changes the mutedChannels property of all AudioChannelManager instances in all apps. Also all audio for all muted channels are muted. The audio's are not automatically paused. Instead applications are expected to listen to the "mutedchanged" event and call pause() as they see fit, for example if they want to resume music where it was when the music was muted.
Line 52: Line 54:


For apps that want to keep being able to play audio when the user leaves the app, the app can call requestWakeLock("audio") to grab an "audio" wakelock. As long as the app holds the "audio" wakelock its mutedChannels property won't change due to the user leaving the app. The mutedChannels property can of course still change if another app calls muteBelow("...").
For apps that want to keep being able to play audio when the user leaves the app, the app can call requestWakeLock("audio") to grab an "audio" wakelock. As long as the app holds the "audio" wakelock its mutedChannels property won't change due to the user leaving the app. The mutedChannels property can of course still change if another app calls muteBelow("...").
=== Open questions ===
Should we remove the muteBelow() and unmuteAll() functions? And instead automatically mute "lower" channels when an <audio> or <video> element for a given channel is played? If so, we'd also need to automatically mute when the telephony API is used.


== System and Browser API changes ==
== System and Browser API changes ==
Confirmed users
716

edits

Navigation menu