HTML Video
lastmod 2026-11-10created 2021-10-192 edits
HTML Video refers to the video element for playing video in HTML5 without plugins, and the JavaScript API that comes with it. Formats supported by the browser (MP4, WebM, Ogg) are provided through src or multiple source children, and behavior and appearance are set with the controls, autoplay, loop, and poster attributes. In scripts, playback is controlled with play(), pause(), currentTime, and events such as timeupdate and ended, while full screen uses the separate Fullscreen API.
Full Screen Mode
var elem = document.getElementById("myvideo");
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}