HTML5中Video,禁止右键下载
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>LOVE</title>
<script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="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 id="myVideo" width="320" height="240" controls>
<source class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="movie.mp4" type="video/mp4">
</video>
</body>
</html>
实现居中显示:
禁止右键下载:
<script>
$(document).ready(function(){
$('#myVideo').bind('contextmenu',function() { return false; });
});
</script>
共同学习,写下你的评论
评论加载中...
作者其他优质文章