mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add fullscreen check to avoid errors in Chrome
This commit is contained in:
parent
53fbc24ac5
commit
9a7ede5536
2 changed files with 14 additions and 4 deletions
|
@ -29,11 +29,14 @@ define(['events', 'dom'], function (events, dom) {
|
||||||
}
|
}
|
||||||
if (element.webkitEnterFullscreen) {
|
if (element.webkitEnterFullscreen) {
|
||||||
element.webkitEnterFullscreen();
|
element.webkitEnterFullscreen();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
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();
|
||||||
|
@ -71,4 +80,4 @@ define(['events', 'dom'], function (events, dom) {
|
||||||
});
|
});
|
||||||
|
|
||||||
return manager;
|
return manager;
|
||||||
});
|
});
|
||||||
|
|
|
@ -692,6 +692,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||||
|
|
||||||
dlg.parentNode.removeChild(dlg);
|
dlg.parentNode.removeChild(dlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
fullscreenManager.exitFullscreen();
|
fullscreenManager.exitFullscreen();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue