Audio mediaGroup attribute
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





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