Name Description Size
AudioChannelAgent.cpp useWeakRef = 9698
AudioChannelAgent.h Header file 2535
AudioChannelService.cpp 28801
AudioChannelService.h We use `AudibleState` to represent the audible state of an owner of audio channel agent. Those information in AudioChannelWindow could help us to determine if a tab is being audible or not, in order to tell Chrome JS to show the sound indicator or delayed autoplay icon on the tab bar. - Sound indicator When a tab is playing sound, we would show the sound indicator on tab bar to tell users that this tab is producing sound now. In addition, the sound indicator also give users an ablility to mute or unmute tab. When an AudioChannelWindow first contains an agent with state `eAudible`, or an AudioChannelWindow losts its last agent with state `eAudible`, we would notify Chrome JS about those changes, to tell them that a tab has been being audible or not, in order to display or remove the indicator for a corresponding tab. - Delayed autoplay icon (Play Tab icon) When we enable delaying autoplay, which is to postpone the autoplay media for unvisited tab until it first goes to foreground, or user click the play tab icon to resume the delayed media. When an AudioChannelWindow first contains an agent with state `eAudible` or `eMaybeAudible`, we would notify Chrome JS about this change, in order to show the delayed autoplay tab icon to user, which is used to notice user there is a media being delayed starting, and then user can click the play tab icon to resume the start of media, or visit that tab to resume delayed media automatically. According to our UX design, we don't show this icon for inaudible media. The reason of showing the icon for a tab, where the agent starts with state `eMaybeAudible`, is because some video might be silent in the beginning but would soon become audible later. --------------------------------------------------------------------------- eNotAudible : agent is not audible eMaybeAudible : agent is not audible now, but it might be audible later eAudible : agent is audible now 9498
crashtests 3
moz.build 721
nsIAudioChannelAgent.idl The suspended enum is used in three different situations, - platform audio focus (Fennec/B2G) - remote media control (Fennec) - block auto-play video in non-active page Note: the "remote side" must control the AudioChannelAgent using nsIAudioChannelAgentCallback.windowSuspendChanged() callback instead using play/pause methods or any button in the webpage. - SUSPENDED_PAUSE : It's used when transiently losing audio focus, the media can't be resumed until we gain the audio focus again. It would change the internal state of MediaElement when it's being suspended/resumed, and it would trigger the related JS event. eg. "play" and "pause" event. - SUSPENDED_BLOCK It's used to prevent auto-playing media in inactive page in order to reduce the power consumption, and the media can't be resumed until the page becomes active again. It would change the internal state of MediaElement when it's being blocked/resumed, so it won't trigger the related JS event. eg. "play" and "pause" event. - SUSPENDED_PAUSE_DISPOSABLE It's used for remote media-control to pause the playing media and when we lose audio focus permanently. It's disposable suspended, so the media can be resumed arbitrary after that. Same as SUSPENDED_PAUSE, it would change the internal state of MediaElement when it's being suspended. - SUSPENDED_STOP_DISPOSABLE It's used for remote media-control to stop the playing media. The remote control would disappear after stopping the media, so we would disconnect the audio channel agent. It's disposable suspended, so the media can be resumed arbitrary after that. Same as SUSPENDED_PAUSE, it would change the internal state of MediaElement when it's being suspended. 5600