Use prefixed document.fullscreen if necessary

This commit is contained in:
Eduard Urbach 2018-12-08 06:45:26 +09:00
parent 24e4906559
commit d2dadb41c7

View File

@ -30,8 +30,9 @@ export function toggleFullscreen(arn: AnimeNotifier, button: HTMLElement) {
let element = document.getElementById(elementId) let element = document.getElementById(elementId)
let requestFullscreen = element.requestFullscreen || element["mozRequestFullScreen"] || element["webkitRequestFullScreen"] || element["msRequestFullscreen"] let requestFullscreen = element.requestFullscreen || element["mozRequestFullScreen"] || element["webkitRequestFullScreen"] || element["msRequestFullscreen"]
let exitFullscreen = document.exitFullscreen || document["mozCancelFullScreen"] || document["webkitExitFullscreen"] || document["msExitFullscreen"] let exitFullscreen = document.exitFullscreen || document["mozCancelFullScreen"] || document["webkitExitFullscreen"] || document["msExitFullscreen"]
let fullscreen = document.fullscreen || document["webkitIsFullScreen"] || document["mozFullScreen"]
if(document.fullscreen) { if(fullscreen) {
exitFullscreen.call(document) exitFullscreen.call(document)
} else { } else {
requestFullscreen.call(element) requestFullscreen.call(element)