HTMLVideoElement: resize イベント
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
resize
は HTMLVideoElement
インターフェイスのイベントで、videoWidth
および videoHeight
プロパティのうち、どちらか一方または両方が更新された直後に発行されます。
このイベントはキャンセル不可ですが、バブリングすることがあります。
構文
このイベント名を addEventListener()
などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
js
addEventListener("resize", (event) => {});
onresize = (event) => {};
イベント型
一般的な Event
です。
例
html
<video id="media" src="https://example.com/video.mp4"></video>
js
const el = document.getElementById("media");
el.addEventListener("resize", () => {
console.log("video 要素の大きさが変わりました。");
});
仕様書
Specification |
---|
HTML # event-media-resize |
HTML # handler-onresize |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
resize event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.