読み取り専用の Document.fullscreenEnabled プロパティは、フルスクリーンモードを使用できるかを示す Boolean を返します。フルスクリーンモードはドキュメント内に windowed プラグインを含まないページ、およびドキュメント内のすべての <iframe> 要素が allowfullscreen 属性を持つページに限り使用できます。
構文
var isFullscreenAvailable = document.fullscreenEnabled;
戻り値 isFullscreenAvailable は、ドキュメントがフルスクリーンモードを使用できる場合に true になります。
例
function requestFullScreen() {
if (document.fullscreenEnabled) {
videoElement.requestFullScreen();
} else {
console.log('Your browser cannot use fullscreen right now');
}
}
仕様
| 仕様書 | 策定状況 | コメント |
|---|---|---|
| Fullscreen API Document.fullscreenEnabled の定義 |
現行の標準 | 最初期の定義 |
ブラウザ実装状況
| 機能 | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| 基本サポート | ? | 10.0 (10.0) mozFullScreenEnabled としてサポート47.0 (47.0) ( full-screen-api.unprefix.enabled で制御) |
? | ? | ? |
| 機能 | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| 基本サポート | ? | 10.0 (10.0) mozFullScreenEnabled としてサポート47.0 (47.0) ( full-screen-api.unprefix.enabled で制御) |
? | ? | ? |