How do you configure S3 and Cloud Front to stream HTML5 video? Tried everything

前端 未结 1 360
感情败类
感情败类 2020-12-24 02:37

I\'ve tried many, many different configurations, files, encoding, browsers, etc..., but this is the simplest example that demonstrates the problem I am having.

If yo

相关标签:
1条回答
  • 2020-12-24 03:05

    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: whatever your video file's content type is
    • Content-Disposition: inline

    Also, make sure your CloudFront distribution is set as a "streaming" distribution and not a "download" one.

    Edit:

    From the AWS docs:

    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.

    Source: http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/ObjectMIMEType.html

    0 讨论(0)
提交回复
热议问题