fullscreenerror kaganapan
Paglilinaw at paggamit
Nangyari ang fullscreenerror kaganapan kapag ang elemento ay hindi ma-see sa full-screen mode, kahit na ito ay hiniling na ma-see.
Note:This event requires a specific prefix to work in different browsers (see more examples below).
Note:Please use element.requestFullscreen() method to view the element in full-screen mode.
Note:Please use element.exitFullscreen() Method to cancel full-screen mode.
Example
If the element cannot be viewed in full-screen mode, prompt some text:
document.addEventListener("fullscreenerror", function() { alert("Fullscreen denied") });
Syntax
In HTML:
<element onfullscreenerror="myScript">
In JavaScript:
object.onfullscreenerror = function(){myScript});
In JavaScript, use the addEventListener() method:
object.addEventListener("fullscreenerror", myScript);
Note:Internet Explorer 8 and earlier versions do not support addEventListener() method.
Technical Details
Bubble: | Supported |
---|---|
Cancelable: | Not supported |
Event type: | Event |
Supported HTML tags: | All HTML elements |
Browser Support
The numbers in the table indicate the first browser version that fully supports this event. Note: Each browser requires a specific prefix (see parentheses):
Event | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
fullscreenerror | 45.0 (webkit) | 11.0 (ms) | 47.0 (moz) | 5.1 (webkit) | 15.0 (webkit) |
Example
Prefixes for cross-browser code usage:
/* Standard syntax */ document.addEventListener("fullscreenerror", function() { ... }); /* Firefox */ document.addEventListener("mozfullscreenerror", function() { ... }); /* Chrome, Safari at Opera */ document.addEventListener("webkitfullscreenerror", function() { ... }); /* IE / Edge */ document.addEventListener("msfullscreenerror", function() { ... });