egret 全屏(安卓/PC浏览器)

	public static SetFullScreen() 
	{
		//document.getElementById("fullScreen").style.display = "none";
		//document.getElementById("exitScreen").style.display = "block";//error
		let el = document.documentElement as any;
		let rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;
		if (typeof rfs != "undefined" && rfs) {
		rfs.call(el);
		};
		return;
  	}
	 public static ExitFullScreen() 
	 {
		//document.getElementById("fullScreen").style.display = "block";
		//document.getElementById("exitScreen").style.display = "none";
		let cfs = document as any;
		if (cfs.exitFullscreen) {
			cfs.exitFullscreen(); 
		} 
		else if (cfs.webkitCancelFullScreen) { 
			cfs.webkitCancelFullScreen(); 
		} 
		else { 
			cfs.msExitFullscreen(); 
		} 
  	}  

 

你可能感兴趣的:(Egret)