Fullscreen
Browser-independent functions for working with the standard fullscreen API.
Methods
-
<static> exitFullscreen
-
Asynchronously exits fullscreen mode. If the browser is not currently in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
-
<static> getFullscreenChangeEventName
-
Gets the name of the event on the document that is fired when fullscreen is entered or exited. This event name is intended for use with addEventListener. In your event handler, to determine if the browser is in fullscreen mode or not, use Fullscreen#isFullscreen.
Returns:
String the name of the event that is fired when fullscreen is entered or exited, orundefinedif fullscreen is not supported. -
<static> getFullscreenElement
-
Gets the element that is currently fullscreen, if any. To simply check if the browser is in fullscreen mode or not, use Fullscreen#isFullscreen.
Returns:
Object the element that is currently fullscreen, ornullif the browser is not in fullscreen mode, orundefinedif the browser does not support fullscreen mode. -
<static> getFullscreenErrorEventName
-
Gets the name of the event that is fired when a fullscreen error occurs. This event name is intended for use with addEventListener.
Returns:
String the name of the event that is fired when a fullscreen error occurs, orundefinedif fullscreen is not supported. -
<static> isFullscreen
-
Determines if the browser is currently in fullscreen mode.
Returns:
Booleantrueif the browser is currently in fullscreen mode,falseif it is not, orundefinedif the browser does not support fullscreen mode. -
<static> isFullscreenEnabled
-
Determine whether the browser will allow an element to be made fullscreen, or not. For example, by default, iframes cannot go fullscreen unless the containing page adds an "allowfullscreen" attribute (or prefixed equivalent).
Returns:
Booleantrueif the browser is able to enter fullscreen mode,falseif not, andundefinedif the browser does not support fullscreen mode. -
<static> requestFullscreen
-
Asynchronously requests the browser to enter fullscreen mode on the given element. If fullscreen mode is not supported by the browser, does nothing.
Parameters:
Name Type Description elementObject The HTML element which will be placed into fullscreen mode. Example
// Put the entire page into fullscreen. Fullscreen.requestFullscreen(document.body) // Place only the Cesium canvas into fullscreen. Fullscreen.requestFullscreen(scene.getCanvas())
-
<static> supportsFullscreen
-
Detects whether the browser supports the standard fullscreen API.
Returns:
trueif the browser supports the standard fullscreen API,falseotherwise.
