有没有办法在 html5/html 5 视频元素上添加水印,用户无法通过进入浏览器控制台/检查模式来删除水印?

发布于 2025-01-16 15:48:14 字数 92 浏览 3 评论 0原文

我想创建一个视频水印,最终用户无法通过操作 DOM 删除该水印。 目前我尝试使用 css 和覆盖层添加水印,如果用户对 DOM 和浏览器元素有一点了解,则很容易删除水印。

I want to create a video watermark, which end user can not remove by manipulating DOM.
Currently I tried adding watermark by using css and overlays, which is pretty easy to remove if user has even a little knowledge about DOM and browser elements.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鼻尖触碰 2025-01-23 15:48:14

您可以尝试一个技巧,但这只是一个理论 - 创建一个将显示实际视频的 SVG 包装器,而不是直接显示所有图像,例如 这个

然后在主页上使用 imgiframe 显示此 SVG 控件。

Sample.svg

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
  <text x="0" y="0">Some watermark goes here</text>
  <foreignObject x="0" y="0" width="300" height="100">
    <video xmlns="http://www.w3.org/1999/xhtml" width="300" height="100">
      <source src="some-video.mp4" type="video/mp4" />
    </video>
  </foreignObject>
</svg>

主页

<img src="sample.svg" />

You can try one trick, but this is just a theory - instead of displaying all images directly, create an SVG wrapper that will be displaying actual video, something like this.

Then on your main page, display this SVG control using img or iframe.

Sample.svg

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
  <text x="0" y="0">Some watermark goes here</text>
  <foreignObject x="0" y="0" width="300" height="100">
    <video xmlns="http://www.w3.org/1999/xhtml" width="300" height="100">
      <source src="some-video.mp4" type="video/mp4" />
    </video>
  </foreignObject>
</svg>

Main page

<img src="sample.svg" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文