HTML Audio/Video DOMmediaGroupProperty
HTML Audio/Video DOM Reference Manual
Example
Set a media group for two videos:
myVid1=document.getElementById("video1");
myVid2=document.getElementById("video2");
myVid1.mediaGroup="test";
myVid2.mediaGroup="test";
myVid2=document.getElementById("video2");
myVid1.mediaGroup="test";
myVid2.mediaGroup="test";
Try it Yourself »
Definition and Usage
The mediaGroup property sets or returns the name of the media group to which the audio/video belongs.
A media group allows two or more audio/video elements to be kept synchronized.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the mediaGroup property.
Syntax
Set the mediaGroup attribute:
audio|video.mediaGroup="group"
Return the mediaGroup attribute:
audio|video.mediaGroup
Property value
| Value | Description |
|---|---|
| group | Specifies the media group of the audio/video. |
Technical Details
| Return value: | A string value indicating the media group of the audio/video. |
|---|
HTML Audio/Video DOM Reference Manualother extensions