Fixed fullscreen for shit browsers
This commit is contained in:
parent
24069ba1c9
commit
24e4906559
@ -28,10 +28,12 @@ function togglePlayVideo(video: HTMLVideoElement) {
|
|||||||
export function toggleFullscreen(arn: AnimeNotifier, button: HTMLElement) {
|
export function toggleFullscreen(arn: AnimeNotifier, button: HTMLElement) {
|
||||||
let elementId = button.dataset.id
|
let elementId = button.dataset.id
|
||||||
let element = document.getElementById(elementId)
|
let element = document.getElementById(elementId)
|
||||||
|
let requestFullscreen = element.requestFullscreen || element["mozRequestFullScreen"] || element["webkitRequestFullScreen"] || element["msRequestFullscreen"]
|
||||||
|
let exitFullscreen = document.exitFullscreen || document["mozCancelFullScreen"] || document["webkitExitFullscreen"] || document["msExitFullscreen"]
|
||||||
|
|
||||||
if(document.fullscreen) {
|
if(document.fullscreen) {
|
||||||
document.exitFullscreen()
|
exitFullscreen.call(document)
|
||||||
} else {
|
} else {
|
||||||
element.requestFullscreen()
|
requestFullscreen.call(element)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user