Cross-browser fullscreen handler utility. Works in IE10+ and mobile browsers (Android - Chrome , iOS - Chrome + Safari)
fullscreenHandler(element [, onEnterCallback, onExitCallback]);
enter
- enter fullscreenexit
- exit fullscreendestroy
remove all even listeners
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();
npm install fullscreen-handler --save
MIT, see LICENSE.md for details.