Summary: | When I check document.webkitFullscreenElement it always returns undefined if I have a video object in fullscreen. It should return the video element. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Raul Jimenez <elecash> |
Component: | Media | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | eric.carlson, jer.noble |
Priority: | P2 | ||
Version: | WebKit Local Build | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 9.0 |
Description
Raul Jimenez
2015-09-20 05:07:41 PDT
The Fullscreen API (and thus document.webkitFullscreenElement) is not supported on iOS. (In reply to comment #1) > The Fullscreen API (and thus document.webkitFullscreenElement) is not > supported on iOS. Extracted from Apple documentation: "The document.webkitFullscreenElement property contains the element that is in full-screen mode. Check if this property is defined to determine if the user is currently in full-screen mode. The document.fullscreenEnabled property detects whether the browser supports the full-screen API, not whether an element is currently full-screen." https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html (In reply to comment #2) > (In reply to comment #1) > > The Fullscreen API (and thus document.webkitFullscreenElement) is not > > supported on iOS. > > Extracted from Apple documentation: > > "The document.webkitFullscreenElement property contains the element that is > in full-screen mode. Check if this property is defined to determine if the > user is currently in full-screen mode. The document.fullscreenEnabled > property detects whether the browser supports the full-screen API, not > whether an element is currently full-screen." > > https://developer.apple.com/library/safari/documentation/AudioVideo/ > Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ > ControllingMediaWithJavaScript.html Ok, that seems the Safari Desktop reference, not Safari iOS reference. Then, it's not possible to detect if a video element is in fullscreen mode with JavaScript? On iOS, you can use video.webkitDisplayingFullscreen, which predates the HTML5 Fullscreen API. (In reply to comment #4) > On iOS, you can use video.webkitDisplayingFullscreen, which predates the > HTML5 Fullscreen API. It worked perfect, thanks :) |