mini-fullscreen
v0.0.9
Published
Mini wrapper for browser Fullscreen API
Downloads
28
Maintainers
Readme
mini-fullscreen
Mini wrapper for browser Fullscreen API
- https://fullscreen.spec.whatwg.org/
- https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
This package is part of WRTC project.
Not yet ready for public use.
If you have different needs regarding the functionality, please add a feature request.
Installation
npm install --save mini-fullscreen
Usage
This package is part of WRTC project.
Not yet ready for public use.
var miniFullScreen = require('mini-fullscreen');
function printStatus(result) {
console.log('result:', result);
console.log('miniFullScreen.getEnabled():', miniFullScreen.getEnabled());
console.log('miniFullScreen.getActive():', miniFullScreen.getActive());
console.log('miniFullScreen.getElement():', miniFullScreen.getElement());
}
function init() {
var htmlElement = document.getElementById('full-element');
miniFullScreen.on('change', function(event) {
console.log('miniFullScreen.on(change):', event);
});
miniFullScreen.on('error', function(event) {
console.log('miniFullScreen.on(error):', event);
});
document.getElementById('action-start').addEventListener('click', function() {
var result = miniFullScreen.start(htmlElement);
printStatus(result);
});
document.getElementById('action-stop').addEventListener('click', function() {
var result = miniFullScreen.stop(htmlElement);
printStatus(result);
});
document.getElementById('action-toggle').addEventListener('click', function() {
var result = miniFullScreen.toggle(htmlElement);
printStatus(result);
});
}
It also sets global variable window.miniFullScreen
(if global window
object exists) to itself.
Credits
Links to package pages:
github.com npmjs.com travis-ci.org coveralls.io inch-ci.org
License
MIT