--- title: Element.onfullscreenerror slug: Web/API/Element/onfullscreenerror tags: - API - Element - Event Handler - Full - Full-screen API - Property - Reference - fullscreen - onfullscreenerror - screen - プロパティ - 全画面モード translation_of: Web/API/Element/onfullscreenerror --- <div>{{ApiRef("Fullscreen API")}}</div> <p><span class="seoSummary">{{domxref("Element")}} インターフェイスの <code><strong>onfullscreenchange</strong></code> プロパティは {{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントのイベントハンドラーで、要素が全画面モードへ移行するか、終了するときにエラーが発生したときに発生します。</span></p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox"><var>targetElement</var>.onfullscreenerror = <var>fullscreenErrorHandler</var>; </pre> <h3 id="Value" name="Value">値</h3> <p>{{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントのエラーハンドラーです。</p> <h2 id="Examples" name="Examples">例</h2> <p>この例は、ユーザーが主導するイベント ({{domxref("Element/click_event", "click")}} や {{domxref("Element/keypress_event", "keypress")}} イベントなど) のハンドラーの外から全画面モードへの切り替えを試みます。全画面モードへの意向は、ユーザー入力への応答の中からしか許可されていないため、これによってエラーが発生し、 {{domxref("Element/fullscreenerror_event", "fullscreenerror")}} イベントをエラーハンドラーに配信します。</p> <pre class="brush: js">let elem = document.querySelector("video")}} elem.onfullscreenerror = function ( event ) { displayWarning("Unable to switch into full-screen mode."); }; //.... elem.requestFullscreen();</pre> <h2 id="Specification" name="Specification">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}</td> <td>{{Spec2("HTML WHATWG")}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("api.Element.onfullscreenerror")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li><a href="/ja/docs/Web/API/Fullscreen_API">Fullscreen API</a></li> <li><a href="/ja/docs/Web/API/Fullscreen_API/Guide">Fullscreen API のガイド</a></li> <li>{{domxref("Element/fullscreenerror_event", "fullscreenerror")}}</li> <li>{{domxref("Element.onfullscreenerror")}}</li> <li>{{domxref("Document.onfullscreenerror")}}</li> </ul>