A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/API/HTMLMediaElement/durationchange_event below:

HTMLMediaElement: durationchange 事件 - Web API

下面的例子为 HTMLMediaElement 的 durationchange 事件添加事件监听器,然后在事件触发时发送一个消息。

使用 addEventListener():

const video = document.querySelector("video");

video.addEventListener("durationchange", (event) => {
  console.log("Not sure why, but the duration of the video has changed.");
});

使用 ondurationchange 事件处理器属性:

const video = document.querySelector("video");

video.ondurationchange = (event) => {
  console.log("Not sure why, but the duration of the video has changed.");
};

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4