Update vd.js
This commit is contained in:
parent
cff8164bcd
commit
00b68959e5
25
js/vd.js
25
js/vd.js
|
@ -277,7 +277,12 @@ const vd = (function() {
|
|||
});
|
||||
|
||||
player._oldRequestFullscreen = player.requestFullscreen;
|
||||
player.requestFullscreen = () => {
|
||||
player.requestFullscreen = function() {
|
||||
var player = document.getElementById(this.id());
|
||||
if (player === null) {
|
||||
return;
|
||||
}
|
||||
player = typeof player.player === "function" ? player.player() : player.player;
|
||||
player._oldRequestFullscreen(...arguments);
|
||||
setTimeout(() => {
|
||||
if (screen.orientation) {
|
||||
|
@ -287,7 +292,12 @@ const vd = (function() {
|
|||
};
|
||||
|
||||
player._oldExitFullscreen = player.exitFullscreen;
|
||||
player.exitFullscreen = () => {
|
||||
player.exitFullscreen = function() {
|
||||
var player = document.getElementById(this.id());
|
||||
if (player === null) {
|
||||
return;
|
||||
}
|
||||
player = typeof player.player === "function" ? player.player() : player.player;
|
||||
player._oldExitFullscreen(...arguments);
|
||||
setTimeout(() => {
|
||||
if (screen.orientation) {
|
||||
|
@ -333,10 +343,15 @@ const vd = (function() {
|
|||
// F -> toggle fullscreen
|
||||
case 70:
|
||||
e.preventDefault();
|
||||
if (player.isFullscreen()) {
|
||||
player.exitFullscreen();
|
||||
let p = document.getElementById(player.id());
|
||||
if (p === null) {
|
||||
break;
|
||||
}
|
||||
p = typeof p.player === "function" ? p.player() : p.player;
|
||||
if (p.isFullscreen()) {
|
||||
p.exitFullscreen();
|
||||
} else {
|
||||
player.requestFullscreen();
|
||||
p.requestFullscreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue