Skip to content

ardean/jsFullscreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsFullscreen

NPM Version NPM Downloads License

WHATWG Fullscreen API Fallback

Demo

Specification

Fullscreen API, WHATWG

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 => ()

License

MIT