Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio mediaGroup attribute

Audio mediaGroup attribute

Audio Object Reference Audio object

Example

Set a media group for two audio tracks:

var x = document.getElementById("myAudio1");

var y = document.getElementById("myAudio2");

x.mediaGroup = "test";

y.mediaGroup = "test";

Try it »


Definition and Usage

The mediaGroup attribute sets or returns the name of the media group to which the audio belongs.

Media grouping allows two or more audio elements to stay in sync.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently no major browser supports the mediaGroup attribute.


Syntax

Return the mediaGroup attribute:

audioObject

.mediaGroup

Set the mediaGroup attribute:

audioObject

.mediaGroup=

group

Attribute values

Value Description
group Specifies the media group of the audio.

Technical Details

Return Value: String value representing the media group of the audio.

Audio Object Reference Audio object