可以禁用“复制链接URL”;在html5视频嵌入代码中? [英] it is possible to disable the "Copy Link URL" in the html5 video embed code?

查看:246
本文介绍了可以禁用“复制链接URL”;在html5视频嵌入代码中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小项目,将一些html5视频嵌入到网站中。



我使用简单的HTML视频嵌入代码

 <视频宽度= 560高度= 340控件> 
< 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>

所以我的问题是,当您右键单击视频时,是否可以禁用复制URL? p>

我知道他们是否真的想获得视频链接,有很多方法可以实现。



但至少



谢谢

解决方案



不过,正如您正确地指出的那样,这只是障碍而不是预防。 HTML5视频是关于直接集成到浏览器中的,因此也可以像图像一样保存。


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

解决方案

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.

这篇关于可以禁用“复制链接URL”;在html5视频嵌入代码中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆