• Multi Channel
• Audio Competing
• Background Play
The beginning of everything..
• one <audio/> in one app.
• two <audio/> in one app.
• two <audio/> in two apps.
• one <audio/> and one not-audio-sound in two
It’s all about UX.
User wants to listen music in background..
User has difﬁculty to mute the background app..
User needs the alarm to sound anyway..
Android solution: audio focus
• App is responsible to request the audio focus on
demand and release the focus actively.
• How to request audio focus in web?
• Volume control of different type of audio source.
• Telephony is not using audio tag.
• FM is not using audio tag.
• New attribute for media tags.
• Background play and competing needs permission
• Expose current occupied media info to system.
• HTML5 Page Visibility
• The page visibility state is simple on desktop
browsers by toggling tabs.
• A little complicated on FirefoxOS
• Window(App) has opening/closing transitions.
• Screen off means page visibility is hidden, too.
• Background page has higher possibility to be
killed. (Memory Management!)
Current Competing Policies
• Channel with higher priority interrupts the
• Foreground page is always playable. But
interruption occurs or not depends on
the channel of the media element.
• When screen is off, the current app or
page is not brought to background now if
it’s playing normal channel audio now.
(Memory and Power concern!)
• Audio elements being interrupted could
know by ‘mozinterruptbegin’ and
• Silent mode under multi channels
• Background play ability of existing web pages
• Background play and competing for video
• Short playing sound is hard to adjust.
• DTMF tones
• Power consumptions.
• Bluetooth earphone has its own proﬁle.
Policy for Silent mode
• Easy for single channel
• Multi channels
• The default channel for volume rockers is
‘notiﬁcation’. (Same as Android)
• Silent mode interesting channels
• Alarm is not affected by silent mode.
Policy for video element
• video doesn’t need to play at background.
• Currently, use ‘visibilitychange’ event.
• video by default shall be able to compete the
background playing content channel.
• Separate background play and audio competing
for video element.
Background play issues
• Existing web pages: “Hey, I’m a music site!”
• How to play when screen is off without adding
mozAudioChannelType to each web site?
• Depart screen off state from invisible page
• EN 50332-1
• Output level through earphone
should be under 85 dBA.
• Prompt a warning when earphone is
plugged and the volume is greater
than 85 dBA.
• The cool down time of CE warning
popup is continuous 20 hours music
OS level policy for CE
• Only apply to content/normal channel.
• Output power is hardware-dependent. Exactly,
we don’t know the db value for speciﬁc devices.
• The CE maximum value is customizable for
different OEM via default settings.