Home  >  Article  >  Web Front-end  >  The html5 video tag blocks the js code for right-clicking the video and saving it as_html5 tutorial skills

The html5 video tag blocks the js code for right-clicking the video and saving it as_html5 tutorial skills

WBOY
WBOYOriginal
2016-05-16 15:48:422926browse

When making HTML5 video tags, we have the download function itself, but in the video area, right-click to "save video as",

to download the video, in order to block "save video as", you can use js Add the following code:

Copy the code
The code is as follows:

$('#myVideo ').bind('contextmenu',function() { return false; });

where myVideo is the id of the video tag, so that the right-click function of the video tag area can be blocked,

But it cannot achieve real shielding (you know...).
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn