0.0.9 • Published 7 years ago

mini-fullscreen v0.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

npm version Build Status Coverage Status Code Climate Inch CI

Dependency Status devDependency Status

mini-fullscreen

Mini wrapper for browser 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

Alexander

Links to package pages:

github.com   npmjs.com   travis-ci.org   coveralls.io   inch-ci.org

License

MIT

0.0.9

7 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago