-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
Conversation
@@ -28,7 +28,7 @@ | |||
], | |||
// Old WebKit | |||
[ | |||
'webkitRequestFullScreen', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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())
There was a problem hiding this comment.
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
- 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
WebKit has deprecated
webkitRequestFullscreen
in favour ofwebkitEnterFullscreen
.Ref: #139
https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1630649-webkitenterfullscreen?language=javascript
https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1633500-webkitenterfullscreen?language=javascript