GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — HTMLVideoElement: resize event - Web APIs | MDN

HTMLVideoElement: resize event

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

  • See full compatibility
  • Learn more

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 addEventListener():

js
addEventListener("resize", (event) => { })

Alternatively, assign to the event handler property of the interface:

js
onresize = (event) => { }

Event type

A generic Event.

Examples

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!");
});

Specifications

Specification
HTML
# event-media-resize
HTML
# handler-onresize

Browser compatibility

See also

  • HTMLVideoElement.videoHeight
  • HTMLVideoElement.videoWidth

Help improve MDN

Learn how to contribute

This page was last modified on Oct 26, 2026 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.