Skip to content

Experience-Monks/fullscreen-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross-browser fullscreen handler utility. Works in IE10+ and mobile browsers (Android - Chrome , iOS - Chrome + Safari)

Syntax

fullscreenHandler(element [, onEnterCallback, onExitCallback]);

API

  • enter - enter fullscreen
  • exit - exit fullscreen
  • destroy remove all even listeners

Example

import fullscreenHandler from 'fullscreen-handler';

const video = document.querySelector('video');
const fs = fullscreenHandler(video);

video.addEventListener('play', fs.enter);
video.addEventListener('pause', fs.exit);

...

// make sure to destroy when it's time
fs.destroy();

Install

npm install fullscreen-handler --save

License

MIT, see LICENSE.md for details.

About

Cross-browser fullscreen handler utility

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published