[英]Linking to S3 file without URL - Rails - aws-sdk
I have an S3 account, on which are stored videos which I need to play using an HTML5 Video element inside a rails application. 我有一个S3帐户,上面存储了我需要使用Rails应用程序中的HTML5 Video元素播放的视频。
Is it possible for me to be able to load the videos into the player without making the video public and directly linking to it? 我是否可以在不公开视频并直接链接到播放器的情况下将视频加载到播放器中?
I have the gem aws-sdk and I read through the documentation and didn't find any information about this. 我有宝石aws-sdk,并且阅读了文档,但没有找到任何有关此的信息。
Excuse me? 劳驾? How is it unclear what I'm asking?
不清楚我要问什么? It's not really possible to make it clearer so I guess I'll basically restate what I already said.
确实不可能使它更清晰,所以我想我基本上会重述我已经说过的话。
I need to be able to this: 我需要能够做到这一点:
<video src="<url of file on S3>">
without making the file public in S3 so anybody can download it. <video src="<url of file on S3>">
而无需在S3中将文件公开,因此任何人都可以下载它。
There is an article page about doing this using the aws-sdk. 有一篇有关使用aws-sdk进行此操作的文章页面。
http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjectPreSignedURLRubySDK.html http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjectPreSignedURLRubySDK.html
I've only ever used Paperclip to do so. 我只用过回形针。
https://github.com/thoughtbot/paperclip/wiki/Restricting-Access-to-Objects-Stored-on-Amazon-S3 https://github.com/thoughtbot/paperclip/wiki/Restricting-Access-to-Objects-Stored-on-Amazon-S3
To access private content in S3 from your rails application, there are multiple approaches available 要从Rails应用程序访问S3中的私有内容,可以使用多种方法
For better performance use AWS Cloufront RTMP distributions for the Videos which serves the files from S3 with Signed URLs and Origin Access Identity limiting public access 为了获得更好的性能,请对视频使用AWS Cloufront RTMP分发,该分发通过签名URL和Origin Access Identity限制公共访问来提供S3中的文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.