jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/fullscreen/fullscreenmanager.js
2017-01-31 16:29:59 -05:00

1 line
1.3 KiB
JavaScript

define(["events","dom"],function(events,dom){"use strict";function fullscreenManager(){}function onFullScreenChange(){events.trigger(manager,"fullscreenchange")}fullscreenManager.prototype.requestFullscreen=function(element){element=element||document.documentElement,element.requestFullscreen?element.requestFullscreen():element.mozRequestFullScreen?element.mozRequestFullScreen():element.webkitRequestFullscreen?element.webkitRequestFullscreen():element.msRequestFullscreen&&element.msRequestFullscreen()},fullscreenManager.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.webkitCancelFullscreen?document.webkitCancelFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},fullscreenManager.prototype.isFullScreen=function(){return!!(document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)};var manager=new fullscreenManager;return dom.addEventListener(document,"fullscreenchange",onFullScreenChange,{passive:!0}),dom.addEventListener(document,"webkitfullscreenchange",onFullScreenChange,{passive:!0}),dom.addEventListener(document,"mozfullscreenchange",onFullScreenChange,{passive:!0}),manager});