it is possible to disable the “Copy Link URL” in the html5 video embed code?

五迷三道 提交于 2019-12-04 06:13:49

问题


I have a small project of doing some html5 videos embed on a site.

I use a simple HTML video embed code

<video width="560" height="340" controls>
  <source src="path/to/myvideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="path/to/myvideo.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>

so my question is that possible to disable the copy URL when you right click on the video?

I know if they really want to get the video link there are ways to do so.

but just at least if I can do that one.

Thanks


回答1:


You can catch right-clicks via JavaScript and thus prevent the right-click menu.

As you correctly noted though, it’s only a hindrance rather than prevention. HTML5 video is about direct integration into the browser and thus can also be saved like images, for example.



来源:https://stackoverflow.com/questions/6478441/it-is-possible-to-disable-the-copy-link-url-in-the-html5-video-embed-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!