From 5c928375e1eb6888786971965d7ba06e21726a61 Mon Sep 17 00:00:00 2001 From: z411 Date: Sun, 31 Mar 2019 05:14:22 -0300 Subject: Arreglada pantalla completa en Webkit --- baitv.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/baitv.js b/baitv.js index 93308af..91078fe 100644 --- a/baitv.js +++ b/baitv.js @@ -403,16 +403,17 @@ function on_hidecomments() { } } +function fullscreenElement() { + return (document.fullscreenElement || + document.webkitFullscreenElement || + document.mozFullScreenElement || + document.msFullscreenElement); +} + function on_fullscreen() { - var elem = document.getElementById("player"); - - if ( - document.fullscreenElement || /* Standard syntax */ - document.webkitFullscreenElement || /* Chrome, Safari and Opera syntax */ - document.mozFullScreenElement ||/* Firefox syntax */ - document.msFullscreenElement /* IE/Edge syntax */ - ) { - console.log("requesting exit full screen"); + var elem = document.getElementById("player"); + + if (fullscreenElement()) { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { /* Firefox */ @@ -459,11 +460,10 @@ function fullscreen_move(e) { } function fullscreen_event() { - console.log("fullscreen event"); var noticebox = document.getElementById("noticebox"); var base = document.getElementById("base"); - if(document.fullscreenElement) { + if(fullscreenElement()) { base.style.position = "absolute"; base.style.opacity = "0.7"; noticebox.style.position = "absolute"; -- cgit v1.2.1-18-gbd029