Handling fullscreen requests can be a little complex so it gets its own class
Methods
(static) init(_ob)
Initialise the manager
Parameters
| Name |
Type |
Description |
_ob |
object
|
| Name |
Type |
Description |
userPrefersFullscreen |
boolean
|
Used to keep track of user preference during this session |
|
(static) setState(_ob)
Enter or exit fullscreen mode
Parameters
| Name |
Type |
Description |
_ob |
object
|
| Name |
Type |
Description |
userInitiated |
boolean
|
true if the user specifically asked for this state (eg by clicking the icon), used to remember their preference and override any future requests by the app if they go against the preference
|
wantsFullscreen |
boolean
|
true if calling for fullscreen, false if wanting to exit fullscreen
|
el |
HTMLElement
|
The element to try to make fullscreen |
|
(static) tryMethodCall(_target_el, _methodName, _description)
Try calling a method to set a DOM element to fullscreen
Different browsers use different methods to go fullscreen, so we may need to try a few before something works.
Parameters
| Name |
Type |
Description |
_target_el |
HTMLElement
|
|
_methodName |
string
|
The method to try |
_description |
string
|
Used in any error messages produced during this attempt |