just like we can get other values. can we also support Enter and Exit full Screen Mode Events promise support.
Not supported yet
Checked and tested on Playground;
Though i tried to do some manual fullScreen mode testing with
// Note that the API is still vendor-prefixed in browsers implementing it
document.addEventListener("webkitfullscreenchange", function( event ) {
// The event object doesn't carry information about the fullscreen state of the browser,
// but it is possible to retrieve it through the fullscreen API
console.log('yes');
if ( document.fullscreen ) {
console.log('no');
// The target of the event is always the document,
// but it is possible to retrieve the fullscreen element through the API
document.fullscreenElement;
}
});
What are you thinking of doing based on these events?
Hi @bdougherty to be very specific,
I want to receive full-screen events callback to be able to stop playing video on mobile devices when the user exits full-screen mode.
Thanks.
@bdougherty Specifically for when iOS exits fullscreen as we can't currently hook into those events b/c iframe.
I would also love to see this. In my use-case the event would trigger a lightbox to display it in a larger screen rather than the traditional full screen. +1
@HowdyMcGee if we do add these events, there would not be a way to override the fullscreen behavior of the player.
Would love to see this, or the “webkitendfullscreen” event passed out to hook on to. My use is this:
Vimeo player is embedded in a modal window on my website, when modal pops up on mobile, user presses play to begin video. If the user stops and closes the video, the modal window is still open and they must close that too before continuing to use the site. I’d like to programmatically close the modal when they have finished with the video, but I currently can’t do that unless they watch until the end.
There is no need for these events in my tests. It's possible to get the target from the fullscreenchange event it seems. See https://codepen.io/luwes/pen/xYJbYg
@luwes - your example doesn't work in ios safari 12 :(
Most helpful comment
@luwes - your example doesn't work in ios safari 12 :(