A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/ja/docs/Web/API/HTMLMediaElement/error_event below:

HTMLMediaElement: error イベント - Web API

HTMLMediaElement: error イベント

Baseline Widely available

error イベントは、リソースがエラーのために読み込めなかったときに発生します(例えば、ネットワーク接続の問題など)。

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

構文

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

addEventListener("error", (event) => {});

onerror = (event) => {};
イベント型

一般的な Event です。

例
const video = document.querySelector("video");
const videoSrc = "https://path/to/video.webm";

video.addEventListener("error", () => {
  console.error(`Error loading: ${videoSrc}`);
});

video.setAttribute("src", videoSrc);
仕様書 ブラウザーの互換性 関連情報

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