Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. Web API
  3. HTMLMediaElement
  4. playing

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

HTMLMediaElement: playing イベント

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.

playing イベントは再生が最初に開始されたときと、再生が再開されたときに発行されます。例えば、データ不足で一時停止や遅延していた再生が再開されたときに発行されます。

このイベントはキャンセル不可で、バブリングしません。

構文

このイベントをaddEventListener() などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。

js
addEventListener("playing", (event) => {});onplaying = (event) => {};

イベント型

一般的なEvent です。

これらの例は、 HTMLMediaElement のplaying イベントにイベントリスナーを追加してから、イベントが発生したことでイベントハンドラーが動作したときにメッセージをポストします。

addEventListener() を使用した例:

js
const video = document.querySelector("video");video.addEventListener("playing", (event) => {  console.log("Video is no longer paused");});

onplaying イベントハンドラープロパティを使用した例:

js
const video = document.querySelector("video");video.onplaying = (event) => {  console.log("Video is no longer paused.");};

仕様書

Specification
HTML
# event-media-playing
HTML
# handler-onplaying

ブラウザーの互換性

関連イベント

関連情報

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp