Video mediaGroup Attribute

Definition and Usage

mediaGroup Properties set or return the name of the media group to which the video belongs.

A media group allows 2 or more <video> elements to stay synchronized.

Instance

Set media groups for 2 videos:

var x = document.getElementById("myVideo1");
var y = document.getElementById("myVideo2");
x.mediaGroup = "test";
y.mediaGroup = "test";

Try It Yourself

Syntax

Return the mediaGroup attribute:

videoObject.mediaGroup

Set the mediaGroup attribute:

videoObject.mediaGroup = group

Attribute Value

Value Description
group Specifies the media group of the video.

Technical Details

Return Value: A string value representing the media group of the video.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 9.0 Support Support Support