HTML5中Video,禁止右键下载
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>LOVE</title>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$(‘#myVideo‘).bind(‘contextmenu‘,function() { return false; });
});
</script>
</head>
<body>
<video style="position:absolute;margin:auto;top:0px;left:0px;right:0px;bottom:0px" id="myVideo" width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
</body>
</html>
实现居中显示:
style="position:absolute;margin:auto;top:0px;left:0px;right:0px;bottom:0px"
禁止右键下载:
<script>
$(document).ready(function(){
$(‘#myVideo‘).bind(‘contextmenu‘,function() { return false; });
});
</script>
原文地址:http://blog.51cto.com/59465168/2114988
时间: 2024-10-09 19:47:56