// 点击全屏
handleFullScreen(): void {
if (this.isFullScreen) {
// 取消全屏
let el: any = document;
if (el.exitFullscreen) {
document.exitFullscreen()
} else if (el.webkitCancelFullScreen) {
el.webkitCancelFullScreen()
} else if (el.mozCancelFullScreen) {
el.mozCancelFullScreen()
} else if (el.msExitFulldcreen) {
el.msExitFulldcreen()
}
this.isFullScreen = false
} else {
// 全屏
let element: any = document.documentElement
if (element.requestFullscreen) {
element.requestFullscreen()
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen()
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen()
} else if (element.msRequestFulldcreen) {
element.msRequestFulldcreen()
}
this.isFullScreen = true
}
}
网友评论