Video mediaGroupProperty
Examples
Set the media group for two videos:
var
x = document.getElementById("myVideo1");
var y = document.getElementById("myVideo2");
x.mediaGroup = "test";
y.mediaGroup = "test";
var y = document.getElementById("myVideo2");
x.mediaGroup = "test";
y.mediaGroup = "test";
Try it Yourself »
Definition and Usage
The mediaGroup property sets or returns the name of the media group that the audio/video belongs to.
Media grouping allows two or more audio/video elements to stay synchronized.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the mediaGroup property
Syntax
Return the mediaGroup property:
videoObject.mediaGroup
Set the mediaGroup property:
videoObject.mediaGroup=group
Property Values
| Value | Description |
|---|---|
| group | Describes the media group of the video. |
Technical Details
| Return Value: | A string, representing the media group of the video. |
|---|
Video Object Other Extensions