HTML5中Video,禁止右键下载
更新:HHH   时间:2023-1-7


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>

返回web开发教程...