I'm using an HTML5 video player on my website and I want to disable right-clicking on all my videos.
I tried using this code and it doesn't work:
<script type="text/javascript">
$(document).ready(function(){
$('#videoElementID').bind('contextmenu',function() { return false; });
});
</script>
I'm using WordPress and placed the function above in the header.php
file.
How can I check what is the #videoElementID
name for my player? I tried with all the DIV elements on the page and it still doesn't work. I know this won't prevent users to download my videos but I really need to make this work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…