web api event
HTMLVideoElement: resize event
The resize event of the HTMLVideoElement interface fires when one or both of the videoWidth and videoHeight properties have just been updated.
This event is not cancelable but may bubble.
Syntax
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("resize", (event) => { })
onresize = (event) => { }
Event type
A generic Event.
Examples
<video id="media" src="https://example.com/video.mp4"></video>
const el = document.getElementById("media");
el.addEventListener("resize", () => {
console.log("The size of the video element has changed!");
});
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.