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/pause_event below:

HTMLMediaElement: pause event - Web API

下面例子给媒体添加 pause 事件监听 handler,然后事件发生时会给 handler 发送一个提醒信息

使用 addEventListener():

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

video.addEventListener("pause", (event) => {
  console.log(
    "The Boolean paused property is now true. Either the " +
      "pause() method was called or the autoplay attribute was toggled.",
  );
});

使用 onpause 事件监听属性:

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

video.onpause = (event) => {
  console.log(
    "The Boolean paused property is now true. Either the " +
      "pause() method was called or the autoplay attribute was toggled.",
  );
};

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