W3Schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPJQUERYBOOTSTRAPANGULARXML
 

Audio mediaGroup Property

Audio Object Reference 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

Internet Explorer Firefox Opera Google Chrome Safari

The mediaGroup property is supported in all major browser.


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 Reference Audio Object