YouTip LogoYouTip

Prop Video Mediagroup

HTML DOM Video mediaGroup Property body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; } h1, h2, h3 { color: #333; } code { background-color: #f4f4f4; padding: 2px 4px; border-radius: 3px; } pre { background-color: #f4f4f4; padding: 10px; border-radius: 5px; overflow-x: auto; } table { border-collapse: collapse; width: 100%; margin: 20px 0; } th, td { border: 1px solid #ddd; padding: 8px; text-align: left; } th { background-color: #f2f2f2; } .note { background-color: #e7f3fe; border-left: 4px solid #2196F3; padding: 10px; margin: 20px 0; } .example { border: 1px solid #ddd; padding: 15px; margin: 20px 0; border-radius: 5px; } .try-it { display: inline-block; background-color: #4CAF50; color: white; padding: 8px 16px; text-decoration: none; border-radius: 4px; margin: 10px 0; } .try-it:hover { background-color: #45a049; } .browser-support img { height: 20px; margin-right: 5px; } .nav-links { margin: 20px 0; } .nav-links a { margin-right: 15px; text-decoration: none; color: #0066cc; } .nav-links a:hover { text-decoration: underline; } .sidebar { background-color: #f9f9f9; padding: 15px; border-radius: 5px; margin: 20px 0; } .sidebar h3 { margin-top: 0; } .sidebar ul { list-style-type: none; padding-left: 0; } .sidebar ul li { margin: 5px 0; } .sidebar ul li a { text-decoration: none; color: #333; } .sidebar ul li a:hover { color: #0066cc; } .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #666; }

HTML DOM Video mediaGroup Property

Video mediaGroup Property

Video Object Reference Video Object

Example

Set a media group for two videos:

var x = document.getElementById("myVideo1");
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 to which the audio/video belongs.

Media grouping allows two or more audio/video elements to stay synchronized.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The mediaGroup property is supported by all major browsers.


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

← Prop Video MutedProp Video Mediagroup β†’