mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
Merge pull request #141 from jellyfin/exit_fullscreen_automatically
Exit fullscreen automatically after video playback ends
This commit is contained in:
commit
fe28f88a99
@ -34,6 +34,9 @@ define(['events', 'dom'], function (events, dom) {
|
|||||||
|
|
||||||
fullscreenManager.prototype.exitFullscreen = function () {
|
fullscreenManager.prototype.exitFullscreen = function () {
|
||||||
|
|
||||||
|
if (!this.isFullScreen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (document.exitFullscreen) {
|
if (document.exitFullscreen) {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
} else if (document.mozCancelFullScreen) {
|
} else if (document.mozCancelFullScreen) {
|
||||||
@ -47,9 +50,15 @@ define(['events', 'dom'], function (events, dom) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: use screenfull.js
|
||||||
fullscreenManager.prototype.isFullScreen = function () {
|
fullscreenManager.prototype.isFullScreen = function () {
|
||||||
|
return document.fullscreen ||
|
||||||
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
|
document.mozFullScreen ||
|
||||||
|
document.webkitIsFullScreen ||
|
||||||
|
document.msFullscreenElement || /* IE/Edge syntax */
|
||||||
|
document.fullscreenElement || /* Standard syntax */
|
||||||
|
document.webkitFullscreenElement || /* Chrome, Safari and Opera syntax */
|
||||||
|
document.mozFullScreenElement; /* Firefox syntax */
|
||||||
};
|
};
|
||||||
|
|
||||||
var manager = new fullscreenManager();
|
var manager = new fullscreenManager();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackManager', 'appRouter', 'appSettings', 'connectionManager', 'htmlMediaHelper', 'itemHelper'], function (browser, require, events, appHost, loading, dom, playbackManager, appRouter, appSettings, connectionManager, htmlMediaHelper, itemHelper) {
|
define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackManager', 'appRouter', 'appSettings', 'connectionManager', 'htmlMediaHelper', 'itemHelper', 'fullscreenManager'], function (browser, require, events, appHost, loading, dom, playbackManager, appRouter, appSettings, connectionManager, htmlMediaHelper, itemHelper, fullscreenManager) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var mediaManager;
|
var mediaManager;
|
||||||
@ -692,6 +692,8 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||||||
|
|
||||||
dlg.parentNode.removeChild(dlg);
|
dlg.parentNode.removeChild(dlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fullscreenManager.exitFullscreen();
|
||||||
};
|
};
|
||||||
|
|
||||||
function onEnded() {
|
function onEnded() {
|
||||||
|
Loading…
Reference in New Issue
Block a user