HTMLMediaElement.mozAudioChannelType

Non-standard
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

The mozAudioChannelType property of the HTMLMediaElement interface can be used to set the audio channel that the sound coming from an <audio> or<video> element will play in, on a Firefox OS device.

Syntax

Value

Example

In the following simple example, we create an <audio> element and two <source> elements, give the player controls, set the mozAudioChannelType to the value of the channelValue variable, set the src and type of the sources, then put the elements in the DOM. Note that it is important to set the audio channel type before you set the audio source.

Note: For a complete working example, see our audio-channels-demo. Try running this on your Firefox OS device as an installed app (install it using App Manager/WebIDE) and then see what happens when you play the music and then put the app in the background, with the channel set to normal, then content.