直接上代码

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<body style="margin: 0px; padding: 0px;">
	<video id="video" width="100%" height="100%" autoplay loop>
		<source src="files/csk.mp4" type="video/mp4">
		<object data="files/csk.mp4" width="320" height="240">
			<embed width="320" height="240" src="movie.swf">
		</object>
	</video>
	<button id="fullScreenBtn">全屏</button>
</body>
</html>
<script type="text/javascript">
	//alert(document.createDocumentFragment);
	function launchFullscreen(element) {
		if (element.requestFullscreen) {
			element.requestFullscreen();
		} else if (element.mozRequestFullScreen) {
			element.mozRequestFullScreen();
		} else if (element.msRequestFullscreen) {
			element.msRequestFullscreen();
		} else if (element.webkitRequestFullscreen) {
			element.webkitRequestFullScreen();
		}
	}

	function exitFullscreen() {
		if (document.exitFullscreen) {
			document.exitFullscreen();
		} else if (document.msExitFullscreen) {
			document.msExitFullscreen();
		} else if (document.mozCancelFullScreen) {
			document.mozCancelFullScreen();
		} else if (document.webkitExitFullscreen) {
			document.webkitExitFullscreen();
		}
	}

	document.querySelector('#fullScreenBtn').onclick = function() {
		window.setTimeout(function enter() {
			launchFullscreen(document.querySelector('#video'));
		});

		window.setTimeout(function exit() {
			exitFullscreen();
		}, 5 * 1000);

	};
</script>


浏览 374 评论 0 赞 0 砸 0 标签: HTML5
评论
还可以再输入500个字

请您注意

·自觉遵守:爱国、守法、自律、真实、文明的原则
·尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法规
·严禁发表危害国家安全,破坏民族团结、国家宗教政策和社会稳定,含侮辱、诽谤、教唆、淫秽等内容的作品
·承担一切因您的行为而直接或间接导致的民事或刑事法律责任
·您在NoteShare上发表的作品,NoteShare有权在网站内保留、转载、引用或者删除
·参与本评论即表明您已经阅读并接受上述条款