DOM

HTMLMediaElement:waiting イベント

 編集:2022.11.03 by T.A.

[Edge]。→

mdn: 一時的にデータが欠落しているために再生が停止したときに発生します。

バブリング なし
キャンセル可能 いいえ
インターフェイス Event
イベント ハンドラー プロパティ onwaiting

GlobalEventHandlers でイベント ハンドラーが定義されている。

HTML:

<VIDEO id=IdTest src="../../Sample/Eizou_M.mp4" controls style="width:300px" muted></VIDEO><BR>
<SPAN id=IdLog></SPAN>

JavaScript:

function Job(eve){   //waiting イベントの処理:
  D=eve;
//  eve.preventDefault();     //イベントの処理動作を行うべきではない…とブラウザーに伝える。
//  DA=eve.defaultPrevented;  //その結果。true
  IdLog.innerHTML=IdLog.innerHTML+"●";
}
IdTest.onwaiting=Job;  //イベント割り当て。
IdTest.src="http://tetuya-amamiya.la.coocan.jp/HTML_R/HTML-Rifarennsu/Sample/Eizou_L.mp4";
IdTest.play();

ファイルを変更して突然 play() するとイベントが発生した。

得られた内容:D。

=[object]:[object Event]
isTrusted=[boolean]:true
type=[string]:waiting
target=[object]:[object HTMLVideoElement]
currentTarget=[object]:null
eventPhase=[number]:0
bubbles=[boolean]:false
cancelable=[boolean]:true
defaultPrevented=[boolean]:false
composed=[boolean]:false


テスト