video 视频全屏播放

      public videofull() {
		//全屏播放视频
		var _this = this;
		_this.video = document.getElementById('homeVideo'); //视频
		_this.btnFullScreen = document.getElementById('btn_fullscreen'); // 全屏点击按钮
		//实现全屏功能
		_this.btnFullScreen.addEventListener('click',function() {
				// if (_this.video.requestFullscreen) {
				// 	_this.video.requestFullscreen();
				// } else if (_this.video.mozRequestFullScreen) {
				// 	_this.video.mozRequestFullScreen();
				// } else if (_this.video.webkitRequestFullscreen) {
				// 	_this.video.webkitRequestFullscreen();
				// } else if (_this.video.msRequestFullscreen) {
				// 	_this.video.msRequestFullscreen();
				// }
				_this.isAutoplay = !_this.isAutoplay;
				// if(!_this.isAutoplay){
				// 	_this.video.play();
				// }
			},
			false
		);
	}

  

猜你喜欢

转载自www.cnblogs.com/mary-123/p/12121883.html