0

A bit of a weird question :) I have a video at https://s3.amazonaws.com/mybucket/myvideo.mp4 and I would like my Meteor server to respond to http://mywebsite.com/myvideo.mp4 exactly as if the video from s3 was living there. So that I can stream, seek etc ie that

<video><source src="http://mywebsite.com/myvideo.mp4" type="video/mp4"></video>

would behave exactly like

<video><source src="https://s3.amazonaws.com/mybucket/myvideo.mp4" type="video/mp4"></video>

while not hosting anything on my server.

This doesn't do the job: it seems to download everything (my server went out of memory...)

The reason of this weird request is that Safari is not doing a great job with CORS (see here and here) and I can't paint to a canvas a video from a different domain... setting crossOrigin and configuring CORS correctly in AWS doesn't solve it.

And just to check: there is no simpler way to set AWS config to make things as if the content was coming from http://mywebsite.com right?

Community
  • 1
  • 1
Guig
  • 9,891
  • 7
  • 64
  • 126

1 Answers1

0

Lots going on here. You're on the right track with reverse proxy, as that's the only way you'll change the outbound source of the files. But for a hosted Meteor app, that is still being developed for AWS integration, so people end up using a reverse proxy like Nginx, which is most popular now for Meteor devs.

The SO question you posted is directions for how to go directly from the S3 bucket, but it looks like what you want to do is serve the content from the bucket (that you own?) and have it's source by your website. In and of itself not hard, you will need to configure your AWS setup so that the content is streamed from your S3 then to your hosted space, and through to the app. Cloudfront is a service they have that can start the process for you, but without knowing more about your server / host setup its hard to troubleshoot. You'll have to specify an origin domain name when delivering content through AWS CF, but you'll surely be able to figure out how to get this to be www.yourwebsite.com, particularly if you're already hosting on AWS and use Nginx.

https://aws.amazon.com/blogs/aws/using-amazon-cloudfront-for-video-streaming/ https://www.jwplayer.com/blog/delivering-hls-with-amazon-cloudfront/