sindresorhus / screenfull

Simple wrapper for cross-browser usage of the JavaScript Fullscreen API
https://sindresorhus.com/screenfull
MIT License
7.08k stars 698 forks source link

screenfull does not work with mobile safari video element API #41

Closed mlegenhausen closed 10 years ago

mlegenhausen commented 10 years ago

Problem:

On iOS devices the fullscreen API is not working for all elements. Requesting fullscreen support for the whole document is not available. But support for the video element is supported via the webkitSupportsFullscreen attribute.

https://developer.apple.com/library/safari/documentation/AudioVideo/Reference/HTMLVideoElementClassReference/HTMLVideoElement/HTMLVideoElement.html#//apple_ref/javascript/instp/HTMLVideoElement/webkitSupportsFullscreen

Possible solution:

It would be nice if screenfull has an isEnabled(element) method so I can check for certain elements and screenfull.request(elem) is working on all platforms.

sindresorhus commented 10 years ago

You don't need screenfull for the video element API, just use it directly. I'm not going to complicate the code for an outdated edge case like this.