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._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);
|
player._oldRequestFullscreen(...arguments);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (screen.orientation) {
|
if (screen.orientation) {
|
||||||
|
@ -287,7 +292,12 @@ const vd = (function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
player._oldExitFullscreen = player.exitFullscreen;
|
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);
|
player._oldExitFullscreen(...arguments);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (screen.orientation) {
|
if (screen.orientation) {
|
||||||
|
@ -333,10 +343,15 @@ const vd = (function() {
|
||||||
// F -> toggle fullscreen
|
// F -> toggle fullscreen
|
||||||
case 70:
|
case 70:
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (player.isFullscreen()) {
|
let p = document.getElementById(player.id());
|
||||||
player.exitFullscreen();
|
if (p === null) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p = typeof p.player === "function" ? p.player() : p.player;
|
||||||
|
if (p.isFullscreen()) {
|
||||||
|
p.exitFullscreen();
|
||||||
} else {
|
} else {
|
||||||
player.requestFullscreen();
|
p.requestFullscreen();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue