lib/index.js
function fullscreenChange(callback) {
    var _document = document;
    return new Promise(function (resolve, reject) {
        if (document.fullscreenEnabled) {
            document.addEventListener('fullscreenchange', callback);
        }
        else if (_document.mozFullScreenEnabled) {
            _document.addEventListener('mozfullscreenchange', callback);
        }
        else if (_document.webkitFullscreenEnabled) {
            _document.addEventListener('webkitfullscreenchange', callback); //Safari
            _document.addEventListener('fullscreenChange', callback); // Edge
        }
        else if (_document.msFullscreenEnabled) {
            _document.addEventListener('MSFullscreenChange', callback);
        }
        else {
            reject();
        }
        resolve();
    });
}
function fullscreenChange(callback) {
    var _document = document;
    return new Promise(function (resolve, reject) {
        if (document.fullscreenEnabled) {
            document.addEventListener('fullscreenchange', callback);
        }
        else if (_document.mozFullScreenEnabled) {
            _document.addEventListener('mozfullscreenchange', callback);
        }
        else if (_document.webkitFullscreenEnabled) {
            _document.addEventListener('webkitfullscreenchange', callback); //Safari
            _document.addEventListener('fullscreenChange', callback); // Edge
        }
        else if (_document.msFullscreenEnabled) {
            _document.addEventListener('MSFullscreenChange', callback);
        }
        else {
            reject();
        }
        resolve();
    });
}
function fullscreenChange ( callback ) { var _document = document ; return new Promise ( function ( resolve , reject ) { if ( document . fullscreenEnabled ) { document . addEventListener ( 'fullscreenchange' , callback ) ; } else if ( _document . mozFullScreenEnabled ) { _document . addEventListener ( 'mozfullscreenchange' , callback ) ; } else if ( _document . webkitFullscreenEnabled ) { _document . addEventListener ( 'webkitfullscreenchange' , callback ) ; //Safari _document . addEventListener ( 'fullscreenChange' , callback ) ; // Edge } else if ( _document . msFullscreenEnabled ) { _document . addEventListener ( 'MSFullscreenChange' , callback ) ; } else { reject ( ) ; } resolve ( ) ; } ) ; }
add eventListener 'fullscreenchange'
@param callback
@return {Promise}
add eventListener fullscreenchange