如何在网页中禁用视频/音频下载? [英] How to disable video/audio downloading in web pages?
问题描述
我有一个网站,我把我的视频/音频放在上面。
我使用HTML5和标签来显示视频。
但是,如果客户打开查看源
页面然后复制文件地址,则可以下载视频/音频。
如何禁用下载这些文件,我只是希望客户在网页上看到视频/听音频。
I have a website that I put my videos/audios on it.
I use HTML5 and tag to show videos.
But videos/audios can be downloaded if client opens view source
page and then copy the file address.
How can I disable downloading these files, I just want client to see videos/hear audios in the web page.
许多在线视频/音频服务,如Youtube通过这种方式禁用下载视频。他们是怎么做到的?什么是禁用或至少使这一进展更难的工作方式?
Many online video/audio services like Youtube disabled downloading videos by this way. How they did that? What is a working way to disable, or at least make this progress much harder?
推荐答案
Youtube将他们的视频编码为 MPEG-DASH 格式,通过浏览器实现媒体源扩展API 。请参阅有关维基百科的详细信息。
Youtube encodes their video into the MPEG-DASH format, which plays back through byte streams via the browser's implementation of the Media Source Extensions API. See See more on Wikipedia.
您可以将视频编码为 MPEG-DASH 文件,然后在您的文件中播放代码通过像 dash.js 这样的库。通过查看 DASH参考客户端。
You can do the same by encoding your video into MPEG-DASH files, then playing it back in your code through a library like dash.js. Watch how the dash.js player works live by checking out the DASH Reference Client.
我使用 Sorenson Squeeze ,但你可以使用其他编码器。
I've encoded MPEG-DASH video using Sorenson Squeeze, but there are other encoders you could use.
只是为了澄清......这将使下载更加困难......但是不会提供真正的DRM解决方案。为此,您需要查看 EME 。
And just to clarify... this will make downloading more difficult... but will NOT provide a real DRM solution. For that you need to check out EME.
这篇关于如何在网页中禁用视频/音频下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!