let v = document.getElementById("myVideo");
v.addEventListener("resize", (ev) => {
let w = v.videoWidth;
let h = v.videoHeight;
if (w && h) {
v.style.width = w;
v.style.height = h;
}
});HTMLVideoElement: videoHeight property / notebook
HTMLVideoElement: videoHeight property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.