Latest web development tutorials
 

Audio mediaGroup Property

< Audio Object

Example

Set the media group for 2 <audio> elements:

var x = document.getElementById("myAudio1");
var y = document.getElementById("myAudio2");
x.mediaGroup = "test";
y.mediaGroup = "test";
Try it Yourself »

Definition and Usage

The mediaGroup property sets or returns the name of the media group the audio is a part of.

A media group allow 2 or more <audio> elements to be kept synchronized.


Browser Support

Property
mediaGroup Yes Yes Yes Yes Yes

Syntax

Return the mediaGroup property:

audioObject.mediaGroup

Set the mediaGroup property:

audioObject.mediaGroup=group

Property Values

Value Description
group Specifies the media group of the audio

Technical Details

Return Value: A String, representing the media group of the audio

< Audio Object