MDN self-hosted library · e01.org

HTMLVideoElement: resize event

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<video id="media" src="https://example.com/video.mp4"></video>
js
const el = document.getElementById("media");
el.addEventListener("resize", () => {
  console.log("The size of the video element has changed!");
});