jsfullscreen
v0.1.0
Published
WHATWG Fullscreen API Fallback
Downloads
2
Maintainers
Readme
jsFullscreen
WHATWG Fullscreen API Fallback
Specification
Usage
I suggest you to use jspm as your package manager.
import Fullscreen from "jsfullscreen";
const fullscreen = new Fullscreen(document.body);
fullscreen.on("change", (isActive) => {
console.log(`fullscreen is ${isActive ? 'active' : 'not active'}`);
});
fullscreen.element.addEventListener("click", () => {
fullscreen.requestFullscreen();
});
Directly in a browser
Please checkout the index-dist.html file for direct usage in a browser.
API
Classes
- Fullscreen
- Constructor(Element element) extends EventEmitter
- Members
- requestFullscreen() => Promise
- Static Members
- exitFullscreen() => Promise
- Properties
- element => Element
- isActive => Boolean
- Static Properties
- fullscreenElement => Element
- isSupported / fullscreenEnabled => Boolean
- Events
- change / fullscreenchange => (Boolean isActive, Event e)
- error / fullscreenerror => (Error err, Event e)
- unsupported => ()