保护我网站上的视频?
我想在 s3 上托管视频。我想将它“嵌入”到我网站的页面中,例如:
http://example.com/demo.html
<video>the video</video>
我不确定如何嵌入视频播放器并将其指向 s3 托管的 url,我只使用了 youtube api 播放器,但这可能是可能的。
我想知道的问题是,是否有一种方法可以阻止人们在知道视频资源的 url 后观看该视频?例如,如果我在网页上找到一张图片的url,我可以复制它的url并直接在浏览器中查看。有办法阻止吗?我希望人们仅在从特定页面观看视频时才能看到该视频。更大的计划是只向在我的网站上创建帐户的会员展示视频。 vimeo api 看起来很有前途,但仅供非商业用途,所以看看 s3 是否可以实现这一点,
谢谢
I'd like to host a video on s3. I would like to 'embed' it in a page within my site, like:
http://example.com/demo.html
<video>the video</video>
I'm not sure how to embed a video player and point it to the url hosted at s3, I've only used the youtube api player for that, but this is probably possible.
The issue I'd like to know about, is if there is a way to block people from viewing the video once they know what the url of the video resource is? For example, if I find the url of a picture on a web page, I can copy its url and view it directly in a browser. Is there a way to stop that? I want people to only see the video if they're viewing it from that specific page. The larger plan is to only show the video to members that have created an account with my website. The vimeo api looked promising but is for non-commercial use only, so seeing if this is possible with s3,
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用存储桶策略功能来保护文件免遭盗取。
以下是允许您防止热链接的存储桶策略示例:
但不要忘记将 your.bucket.name 替换为您的实际存储桶名称,并将 yourwebsitename 替换为您的网站站点名称。
您可以使用 S3 浏览器 免费软件查看和编辑存储桶策略。您可以找到更多存储桶策略示例 在这里。
you can use Bucket Policies feature to protect files from leeching.
Here is an example of bucket policy that allows you to prevent hotlinking:
But don't forget to replace your.bucket.name with your actual bucket name and yourwebsitename with your web site name.
You can view and edit Bucket Policies with S3 Browser Freeware. You can find more Bucket Policies examples here.
这有点像猫捉老鼠的游戏,有一个 Firefox 扩展:"DownloadHelper",它可以从大多数嵌入式应用程序中抓取视频来源。如果重要的是人们无法拍摄视频并做他们想做的事,您可能需要研究某种 DRM 方式,但这也不是万无一失的,在这种情况下可能有点矫枉过正。
It's a bit of a cat and mouse game, there's a Firefox extension: "DownloadHelper" that grabs video from most embedded sources. If it's important people aren't able to take the video and do what they please, you may want to look into some manner of DRM, but that's also not bullet proof, and might be overkill in this case.
如果您拥有该服务器,则可以执行一些操作,例如在仅临时有效的 URL 上提供视频(随 HTTP 会话过期或在 5 分钟后过期等)。然而,由于您是在 S3 上提供服务,而您对 S3 的控制权为零,因此这种技术不可用。除此之外,S3 URL 是一个很好的老式 URL,如果视频播放器可以访问它,则也可以通过任何其他方式访问......
If you own the server, you can do things like serve the video at a URL that is only temporarily valid (expires with the HTTP session or after 5 minutes or something). However, since you are serving off of S3, which you have zero control over, that kind of technique is unavailable. Beyond that, an S3 URL is a good old fashioned URL which, if it is reachable by the video player, is reachable any other way as well...
我没有使用过 s3,所以我不知道具体细节,但我要做的是拥有一个客户端 Silverlight/Flash 播放器,它可以从引用视频文件的 URL 进行流式传输(如果您想使用 Silverlight,请检查 MediaPlayer 元素),然后它应该连接到您的网络服务器上的通用处理程序,该处理程序将提供来自 s3 的内容,就好像它确实拥有该内容一样。一旦您完成了该工作,您就可以将处理程序与当前的安全性(会话等)集成以检查它们是否已登录。
通用处理程序是一个 ASHX 文件,用 .NET 编写,非常灵活。最近,我需要跟踪图像的带宽使用情况 - 我编写了一个处理程序,它将添加到 SQL 数据库中的计数器,然后通过设置内容类型来提供图像。因此,用户将加载 http:www.mydomain.com/pichandler.ashx?file=grrr.jpg ,它将生成一个图像,就好像他们直接访问该图像一样。
ps 我所说的解决方案需要 .NET 知识 - 我不知道你将使用什么语言。
I have not used s3 so I dont know the specifics, but what I would do is have a client side Silverlight/Flash player that can stream from a URL referencing a video file(checkout the MediaPlayer element if you want to use Silverlight), then that should connect to a generic handler on your webserver that will serve the content from s3 as if it actually had the content. Once you had that working you could integrate the handler in with your current security(sessions etc) to check that they are logged in.
A generic handler is an ASHX file, written in .NET thats very flexible. Recently I needed to track bandwidth usage for an image - I wrote a handler that would add to a counter in the SQL db, then serve the image by setting the contenttype. So the user would load http:www.mydomain.com/pichandler.ashx?file=grrr.jpg and it would produce an image as if they went directly to the image.
p.s. The solution im talking about would need knowledge of .NET - I dont know what language you will be using.