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

WebKit deprecated request in favour of enter #160

Closed
wants to merge 1 commit into from
Closed

WebKit deprecated request in favour of enter #160

wants to merge 1 commit into from

Conversation

@@ -28,7 +28,7 @@
],
// Old WebKit
[
'webkitRequestFullScreen',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to leave the old one for older browsers to happen?

@@ -23,7 +23,7 @@
],
// New WebKit
[
'webkitRequestFullscreen',
'webkitEnterFullscreen',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work as the webkitEnterFullscreen only present in the HTMLVideoElement object, not in the document. There should be a way to check whether video object has ability to enter fullscreen.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ye you're right @RusinovAnton, not sure how I missed that. It seems like you can't request fullscreen on the document in Safari? I just tried and nothing worked. Has it always been like this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find actual info on that. I can see that there is no webkitEnterFullscreen property on document object in Safari. However. there is a document.documentElement.webkitRequestFullscreen which seems like not working for me. I've tried to find maybe there are some feature flags I can enable, but couldn't find any.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh-oh, it actually works if its triggered not from the console but from the user input even, like button click! -

button.addEventListener('click', ()=> document.documentElement.webkitRequestFullscreen())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no document.documentElement.webkitEnterFullscreen property, tho

and the doc on it is pretty much empty :(

https://developer.apple.com/documentation/tvmljs/document/1630671-documentelement

@mihar-22 mihar-22 closed this Nov 14, 2019
RusinovAnton added a commit to Syndicode/normalize-fullscreen that referenced this pull request Nov 21, 2019
- main reason for the rewrite was incorrect fs api detection for iphone,
see more details sindresorhus#160
- in the process, use-fullscreen hook was added
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

Successfully merging this pull request may close these issues.

2 participants