toggleFullscreen() {
const isFullscreen = document.webkitIsFullScreen || document.fullscreen;
const canvas = document.getElementById(this.videoId);
if (isFullscreen) {
const exitFunc =
document.exitFullscreen || document.webkitExitFullscreen;
exitFunc.call(document);
} else {
const element = this.$refs.vcontainer;
const fullscreenFunc =
element.requestFullscreen || element.webkitRequestFullScreen;
fullscreenFunc.call(element);
}
}
网友评论