Playback from an Amazon S3 Video Folder does not work for H.264 (MP4) content, but does for H.264 TS

Issue or Problem:


Attempts to playback H.264 (MP4) content does not work when that content resides on an Amazon S3 video folder in SnapStream.  However, playing back H.264 TS files from that same S3 video folder works fine.


Developer Console in the browser will show a message saying something like, "Cross-Origin Request Blocked" or "Blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."


Cause:


This is an indication that the Cross-origin resource sharing (CORS) policy in place on your S3 bucket hasn't been configured to authorize the origin that is your SnapStream system to make GET, POST, and PULL requests.


Solution:


Instructions on how to Configure CORS on your S3 bucket can be found here:  https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors


Instructions on how to implement the CORS configuration on your S3 bucket can be found here: 


https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-cors-configuration.html


NOTE:  An example CORSconfig.xml file that allows all origins to have the necessary permissions for playback to work in SnapStream is attached at the bottom of this article.  However, implementing this is not very secure.  You would want to change the lines like below...


<AllowedOrigin>*</AllowedOrigin>


to specify your snapstream system like below...


<AllowedOrigin>http://mysnapstreamsystem</AllowedOrigin>


Additional Notes:


If you are unsure what to do, please contact your Amazon S3 administrator.


Applies to Version:


9.1, 9.2, 9.3, 9.4 and above.


Keywords:


Amazon S3 SnapStream Video Folder Playback

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

Have more questions?

Submit a Request