Eric Belisle Giddings
Eric Belisle Giddings

Reputation: 471

Detect If Device / Browser Supports Fullscreen API

How can one tell if a browser supports FullScreen API in JavaScript?

From my understanding, the latest Safari allows it on iPads and not iPhone.

I am wondering how I can detect if the device supports it so I can conditionally show or hide a fullscreen button.

(Ideally in Angular using TypeScript)

Upvotes: 0

Views: 762

Answers (1)

Ashish Ranjan
Ashish Ranjan

Reputation: 12960

document.fullscreenEnabled

The fullscreenEnabled property tells you whether or not it is possible to engage full-screen mode. This is false if full-screen mode is not available for any reason (such as the "fullscreen" feature not being allowed, or full-screen mode not being supported).

Upvotes: 2

Related Questions