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.

It is a non-standard property, defined in the AudioChannels API; see Using the AudioChannels API for more details.


var player = document.createElement('audio');
var myAudioChannelType = player.mozAudioChannelType;
myAudioChannelType = 'content';


A DOMString value.


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.

var channelValue = 'content';

function createAudio(channelValue) { 
  var player = document.createElement('audio');
  var source1 = document.createElement('source');
  var source2 = document.createElement('source');

  player.controls = true;
  player.mozAudioChannelType = channelValue;
  source1.src = 'audio/dragon.ogg';
  source1.type = 'audio/ogg';
  source2.src = 'audio/dragon.mp3';
  source2.type = 'audio/mpeg';


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.


The AudioChannels API has no official spec at the moment; see for implementation details, WebIDL, etc.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
General support Not supported Not supported Not supported Not supported Not supported
Feature Android Chrome Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
General support Not supported Not supported Not supported 1.0.1 Not supported Not supported Not supported

See also


© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.

API AudioChannels Firefox OS HTMLMediaElement Non-standard Property Reference Référence