FullScreenPlugin
Defined in: plugins/FullScreenPlugin.ts:69
Cross-browser fullscreen functionality plugin for web applications.
Provides comprehensive fullscreen mode management with automatic browser compatibility handling, event management, and flexible element targeting. Supports all major browsers including Chrome, Firefox, Safari, and Edge.
Key Features:
- Cross-browser fullscreen API compatibility
- Automatic event handling and state synchronization
- Flexible element targeting (container, window, or custom elements)
- Signal-based event system for reactive programming
- Graceful fallback handling for unsupported browsers
- Automatic cleanup and error handling
Example
Section titled “Example”// Get the fullscreen pluginconst fullscreen = app.plugins.get<IFullScreenPlugin>('fullscreen');
// Listen for fullscreen changesfullscreen.onFullScreenChange.connect((isFullscreen) => { console.log('Fullscreen state:', isFullscreen); updateUIForFullscreen(isFullscreen);});
// Toggle fullscreen modedocument.getElementById('fullscreenBtn').addEventListener('click', () => { if (fullscreen.canFullscreen) { fullscreen.toggleFullScreen(); } else { console.warn('Fullscreen not supported'); }});
// Set custom element for fullscreenconst gameContainer = document.getElementById('gameContainer');fullscreen.setFullScreenElement(gameContainer);fullscreen.setFullScreen(true);
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FullScreenPlugin():
FullScreenPlugin
Defined in: plugins/FullScreenPlugin.ts:121
Creates the fullscreen plugin instance. Binds all methods to maintain proper context when used as event handlers.
Returns
Section titled “Returns”FullScreenPlugin
Overrides
Section titled “Overrides”Properties
Section titled “Properties”__dill_pixel_method_binding_root
Section titled “__dill_pixel_method_binding_root”__dill_pixel_method_binding_root:
boolean
Defined in: plugins/Plugin.ts:39
Inherited from
Section titled “Inherited from”Plugin
.__dill_pixel_method_binding_root
readonly
id:"fullscreen"
='fullscreen'
Defined in: plugins/FullScreenPlugin.ts:71
Plugin identifier for framework registration
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”onFullScreenChange
Section titled “onFullScreenChange”onFullScreenChange:
Signal
<(isFullscreen
) =>void
>
Defined in: plugins/FullScreenPlugin.ts:77
Signal emitted when fullscreen state changes. Provides the new fullscreen state as a boolean parameter.
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.onFullScreenChange
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get app():
Application
Defined in: plugins/FullScreenPlugin.ts:130
Gets the application instance.
Returns
Section titled “Returns”The singleton Application instance
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”canFullscreen
Section titled “canFullscreen”Get Signature
Section titled “Get Signature”get canFullscreen():
boolean
Defined in: plugins/FullScreenPlugin.ts:259
Checks if the current environment and element support fullscreen functionality.
Example
Section titled “Example”if (fullscreenPlugin.canFullscreen) { // Show fullscreen button fullscreenButton.style.display = 'block';} else { // Hide fullscreen button or show alternative fullscreenButton.style.display = 'none'; console.log('Fullscreen not supported on this device');}
Returns
Section titled “Returns”boolean
True if fullscreen is supported and available
Whether the current environment supports fullscreen functionality
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.canFullscreen
fullScreenElement
Section titled “fullScreenElement”Get Signature
Section titled “Get Signature”get fullScreenElement():
null
|HTMLElement
|Window
Defined in: plugins/FullScreenPlugin.ts:113
Gets the current fullscreen target element.
Returns
Section titled “Returns”null
| HTMLElement
| Window
The element currently set for fullscreen operations
Set Signature
Section titled “Set Signature”set fullScreenElement(
value
):void
Defined in: plugins/FullScreenPlugin.ts:105
Sets the element to be used for fullscreen operations.
Parameters
Section titled “Parameters”The HTML element or Window object to use for fullscreen
null
| HTMLElement
| Window
Returns
Section titled “Returns”void
The HTML element or Window object used for fullscreen operations
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.fullScreenElement
isFullscreen
Section titled “isFullscreen”Get Signature
Section titled “Get Signature”get isFullscreen():
boolean
Defined in: plugins/FullScreenPlugin.ts:278
Checks if the document is currently in fullscreen mode. Uses browser-specific properties for cross-browser compatibility.
Returns
Section titled “Returns”boolean
True if any element is currently in fullscreen mode
isFullScreen
Section titled “isFullScreen”Get Signature
Section titled “Get Signature”get isFullScreen():
boolean
Defined in: plugins/FullScreenPlugin.ts:97
Gets the current fullscreen state.
Returns
Section titled “Returns”boolean
True if currently in fullscreen mode
Set Signature
Section titled “Set Signature”set isFullScreen(
value
):void
Defined in: plugins/FullScreenPlugin.ts:88
Sets the fullscreen state and triggers the appropriate fullscreen operation.
Parameters
Section titled “Parameters”boolean
True to enter fullscreen, false to exit
Returns
Section titled “Returns”void
Current fullscreen state
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.isFullScreen
options
Section titled “options”Get Signature
Section titled “Get Signature”get options():
O
Defined in: plugins/Plugin.ts:44
Returns
Section titled “Returns”O
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: plugins/Plugin.ts:79
Add signal connections to the container.
Parameters
Section titled “Parameters”…SignalConnection
[]
The signal connections to add.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.addSignalConnection
Inherited from
Section titled “Inherited from”clearSignalConnections()
Section titled “clearSignalConnections()”clearSignalConnections():
void
Defined in: plugins/Plugin.ts:85
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.clearSignalConnections
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Defined in: plugins/FullScreenPlugin.ts:157
Cleans up the plugin by removing all event listeners. Called automatically when the plugin is destroyed.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”initialize()
Section titled “initialize()”initialize():
void
Defined in: plugins/FullScreenPlugin.ts:145
Initializes the fullscreen plugin by setting up browser event listeners. Registers listeners for all major browser fullscreen change events.
Returns
Section titled “Returns”void
Example
Section titled “Example”// Called automatically by the plugin system// Registers listeners for: fullscreenchange, webkitfullscreenchange,// mozfullscreenchange, msfullscreenchange
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”postInitialize()
Section titled “postInitialize()”postInitialize(
_app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:68
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
| Promise
<void
>
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.postInitialize
Inherited from
Section titled “Inherited from”setFullScreen()
Section titled “setFullScreen()”setFullScreen(
value
):void
Defined in: plugins/FullScreenPlugin.ts:207
Sets the fullscreen state explicitly
Parameters
Section titled “Parameters”boolean
True to enter fullscreen, false to exit fullscreen
Returns
Section titled “Returns”void
Example
Section titled “Example”// Enter fullscreen modefullscreenPlugin.setFullScreen(true);
// Exit fullscreen modefullscreenPlugin.setFullScreen(false);
// Conditional fullscreen based on game stateif (gameState === 'playing') { fullscreenPlugin.setFullScreen(true);}
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.setFullScreen
setFullScreenElement()
Section titled “setFullScreenElement()”setFullScreenElement(
value
):void
Defined in: plugins/FullScreenPlugin.ts:235
Sets the element to be used for fullscreen operations
Parameters
Section titled “Parameters”The HTML element or Window to use for fullscreen operations
null
| HTMLElement
| Window
Returns
Section titled “Returns”void
Example
Section titled “Example”// Use a specific game containerconst gameDiv = document.getElementById('game-container');fullscreenPlugin.setFullScreenElement(gameDiv);
// Use the entire windowfullscreenPlugin.setFullScreenElement(window);
// Reset to default (application container)fullscreenPlugin.setFullScreenElement(null);
Implementation of
Section titled “Implementation of”IFullScreenPlugin
.setFullScreenElement
toggleFullScreen()
Section titled “toggleFullScreen()”toggleFullScreen():
void
Defined in: plugins/FullScreenPlugin.ts:184
Toggles between fullscreen and windowed mode
Returns
Section titled “Returns”void
Example
Section titled “Example”// Toggle fullscreen on button clickbutton.addEventListener('click', () => { fullscreenPlugin.toggleFullScreen();});
// Keyboard shortcut for fullscreendocument.addEventListener('keydown', (e) => { if (e.key === 'F11') { e.preventDefault(); fullscreenPlugin.toggleFullScreen(); }});