HTMLMediaElement: waiting イベント

Baseline Widely available

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

waiting イベントは、一時的にデータが欠落したために再生が停止したときに発生します。

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

構文

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

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

onwaiting = (event) => {};

イベント型

一般的な Event です。

これらの例は、 HTMLMediaElement の waiting イベントのイベントリスナーを追加し、イベントの発生によりイベントハンドラーが動作したときにメッセージを登録します。

addEventListener() を使用する場合

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

video.addEventListener("waiting", (event) => {
  console.log("Video is waiting for more data.");
});

onwaiting イベントハンドラープロパティを使用する場合

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

video.onwaiting = (event) => {
  console.log("Video is waiting for more data.");
};

仕様書

Specification
HTML
# event-media-waiting
HTML
# handler-onwaiting

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
waiting event

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連イベント

関連情報