删除 document.onfullscreenchange 全屏 API
Removing document.onfullscreenchange Fullscreen API
我有一个页面正在检查用户是否离开了全屏。我想 delete/destroy 这个事件观察者但无法在描述中找到我如何做到这一点
API Description
这是我的代码:
//create black background and disable scrolling
$rootScope.fullScreen = !$rootScope.fullScreen;
//make div fullScreen (Browser Native)
if($rootScope.fullScreen == true) {
var videoWindow = document.getElementById("full-screen");
if (videoWindow.requestFullscreen) {
videoWindow.requestFullscreen();
}
//check if user has closed fullscreen
document.onwebkitfullscreenchange = function ( event ) {
if(!document.webkitFullscreenElement) {
$rootScope.fullScreen = false;
//REMOVE THE EVENTHANDLER - STOP WATCHING!
?????????
}
};
您删除活动的目的是什么?
document.onwebkitfullscreenchange = null;
应该可以。
我有一个页面正在检查用户是否离开了全屏。我想 delete/destroy 这个事件观察者但无法在描述中找到我如何做到这一点 API Description 这是我的代码:
//create black background and disable scrolling
$rootScope.fullScreen = !$rootScope.fullScreen;
//make div fullScreen (Browser Native)
if($rootScope.fullScreen == true) {
var videoWindow = document.getElementById("full-screen");
if (videoWindow.requestFullscreen) {
videoWindow.requestFullscreen();
}
//check if user has closed fullscreen
document.onwebkitfullscreenchange = function ( event ) {
if(!document.webkitFullscreenElement) {
$rootScope.fullScreen = false;
//REMOVE THE EVENTHANDLER - STOP WATCHING!
?????????
}
};
您删除活动的目的是什么?
document.onwebkitfullscreenchange = null;
应该可以。