const video = document.querySelector("video");
video.addEventListener("loadedmetadata", (event) => {
console.log(
"The duration and dimensions of the media and tracks are now known.",
);
});HTMLMediaElement: loadedmetadata event / notebook
HTMLMediaElement: loadedmetadata event
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const video = document.querySelector("video");
video.onloadedmetadata = (event) => {
console.log(
"The duration and dimensions of the media and tracks are now known.",
);
};