如何配置S3和云锋流HTML5视频?尝试了一切 [英] How do you configure S3 and Cloud Front to stream HTML5 video? Tried everything
问题描述
我已经尝试了许多,许多不同的配置,文件编码,浏览器,等等,但是这是证明我有这个问题最简单的例子。
I've tried many, many different configurations, files, encoding, browsers, etc..., but this is the simplest example that demonstrates the problem I am having.
如果您粘贴的URL,在FF 8.0.1为JSPlayer样本视频,视频播放内嵌:
If you paste the url for the sample video for JSPlayer in FF 8.0.1, the video plays inline:
<一个href="http://video-js.zen$c$cr.com/oceans-clip.webm">http://video-js.zen$c$cr.com/oceans-clip.webm
如果我采取相同的视频并上传到我的S3存储,它会触发下载,而不是:
If I take that same video and upload it to my s3 bucket, it triggers download instead:
<一个href="https://s3.amazonaws.com/turingvideos/oceans-clip.webm">https://s3.amazonaws.com/turingvideos/oceans-clip.webm - 要么 - HTTP
https://s3.amazonaws.com/turingvideos/oceans-clip.webm -- or -- http
(读为大家对文件和铲斗权限)
(Permissions are read for everyone on the file and bucket)
那么,让我们尝试云锋。
So, let's try Cloud Front.
d2yat6m71lu23b点CloudFront的点网的斜线与海洋clip.webm(下载触发)
d2yat6m71lu23b dot cloudfront dot net slash oceans-clip.webm (download trigger)
和云锋流:
strzsu4h2ax96点CloudFront的点网的斜线与海洋clip.webm(无限微调)
strzsu4h2ax96 dot cloudfront dot net slash oceans-clip.webm (infinite spinner)
同样的基本使用的东西,以及一个HTML视频标签时发生。做工精细禅codeR,borked以外的任何本地磁盘的读取等。
The same basic things happen when using an html video tag as well. Works fine from zencoder, borked on anything other than local disk read.
那么,是什么神奇的是禅宗codeR管理这完全是出于我与S3 / CloudFront的范围?我完全难住了。
So, what magic is zencoder managing that is completely out of my reach with S3/CloudFront? I'm completely stumped.
编辑:
设置内容类型和处置,以视频/ WEBM和内联的伎俩。感谢您的快速反应家伙。
Setting the content type and disposition to "video/webm" and "inline" did the trick. Thanks for the quick response guys.
推荐答案
使用S3的Web管理控制台( https://开头的控制台。 aws.amazon.com/s3 ),选择你的水桶,用鼠标右键单击您的视频文件之一,切换到元数据标签,并设置2头:
Using the S3 web management console (https://console.aws.amazon.com/s3), select your bucket, right-click one of your video files, switch to the metadata tab and set 2 headers:
- 的Content-Type:无论你的视频文件的内容类型为
- 内容处置:内联
此外,请确保您的CloudFront的分布设置为流的分配,而不是一个下载之一。
Also, make sure your CloudFront distribution is set as a "streaming" distribution and not a "download" one.
编辑:
从AWS文档:
CloudFront的服务器并不确定MIME类型,他们所服务的对象。因此,当你的对象上传到你的出身,你应该设置对象的Content-Type头。
CloudFront servers don't determine the MIME type for the objects they serve. Therefore, when you upload an object to your origin, you should set the object's Content-Type header.
来源:<一href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/ObjectMIMEType.html">http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/ObjectMIMEType.html
这篇关于如何配置S3和云锋流HTML5视频?尝试了一切的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!