Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iphone safair support webkitEnterFullscreen. #221

Open
TianbinTobin opened this issue Mar 1, 2023 · 16 comments
Open

Iphone safair support webkitEnterFullscreen. #221

TianbinTobin opened this issue Mar 1, 2023 · 16 comments

Comments

@TianbinTobin
Copy link

Iphone safair support webkitEnterFullscreen, not webkitRequestFullscreen

@DmytroShulzhenko
Copy link

Can you add webkitEnterFullscreen for supporting full screen mode for Iphones?

@justingolden21
Copy link

+1 to this, not working on iphone

@WINOFFRG
Copy link

+1 Much Needed, Currently have to work with webkitEnterFullscreen and webkitExitFullscreen

@chrisandrews7
Copy link

+1

@BePo65
Copy link

BePo65 commented Sep 28, 2023

There seems to be a small bug in the screenfull code (lines 14 and 24):

For apple / safari it uses webkitRequestFullscreen (in compliance with mdn and CanIuse).

But according to the apple documentation, safari not only requires the webkit prefix, but also uses a different wording: webkitEnterFullscreen.

@justingolden21
Copy link

If I (or someone else) make a PR for this, is there any chance it would be merged?

@ screenfull team

@aquinoWill
Copy link

+1

@BePo65
Copy link

BePo65 commented Feb 9, 2024

I will prepare a pr for this; only testing on ios is a little bit difficult for me.

@baharev
Copy link

baharev commented Feb 9, 2024

I have tested it on an iPhone with Safari 17.2 and based on my own experiments and on the official docs:

webkitEnterFullscreen is only available for the HTMLVideoElement as of Feb 9, 2024.

It makes little sense to me, since full screen is the default for the video element on the iPhone and you have to opt-out by specifying playsinline if you don't want that. The video element also has its own control to toggle the full screen mode, making webkitEnterFullscreen superfluous.

For other HTML elements, webkitEnterFullscreen seems to be absent on the iPhone.

Long story short: Even if webkitEnterFullscreen is added to screenfull library, it won't make a difference on an iPhone.

@BePo65
Copy link

BePo65 commented Feb 12, 2024

Perhaps I can help with a little web page that shows the fullscreen features available on 'your' browser.

@baharev
Copy link

baharev commented Feb 12, 2024

Perhaps I can help with a little web page that shows the fullscreen features available on 'your' browser.

I don't get the point you are trying to make but here is a screenshot made on that iPhone with Safari 17.2

IMG_4950

@BePo65
Copy link

BePo65 commented Feb 13, 2024

The page just proves that iPhone does not support the Fullscreen API (besides for HTMLVideoElement) as you said before and thus a or is useless.

@cay-cospete
Copy link

cay-cospete commented Feb 26, 2024

I have tested it on an iPhone with Safari 17.2 and based on my own experiments and on the official docs:

webkitEnterFullscreen is only available for the HTMLVideoElement as of Feb 9, 2024.

It makes little sense to me, since full screen is the default for the video element on the iPhone and you have to opt-out by specifying playsinline if you don't want that. The video element also has its own control to toggle the full screen mode, making webkitEnterFullscreen superfluous.

For other HTML elements, webkitEnterFullscreen seems to be absent on the iPhone.

Long story short: Even if webkitEnterFullscreen is added to screenfull library, it won't make a difference on an iPhone.

Why is that playsInline attribute is correlated with fullscreen mode on Safari ? Also, why is that adding webkitEnterFullscreen in the fullscreen library wont make a difference ?

@BePo65
Copy link

BePo65 commented Feb 26, 2024

Also, why is that adding webkitEnterFullscreen in the fullscreen library wont make a difference ?

If you take a look at my testpage with an iPhone (I don't have one available): what does it say for 'webkitEnterFullscreen'?

@cay-cospete
Copy link

Also, why is that adding webkitEnterFullscreen in the fullscreen library wont make a difference ?

If you take a look at my testpage with an iPhone (I don't have one available): what does it say for 'webkitEnterFullscreen'?

It says unavailable for all but i am trying to understand why ?, when i tested on iphone 12 pro on browserstack by attaching this api on the browser console it worked fine

@BePo65
Copy link

BePo65 commented Feb 26, 2024

Ok, I think I understand.

What this 'demopage' does is feature detection. for the fullscreen API. As webkitRequestFullscreen and webkitEnterFullscreen are features of an element, I test the availability for a div element based on code found in MDN:

"webkitRequestFullscreen" in  window.document.createElement('div');
"webkitEnterFullscreen" in  window.document.createElement('div');

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants