html5 - get around cross-origin resource sharing on Amazon Aws -


i creating virtual reality 360-degree video website using krpano html5 player.

this going great until testing on safari , realised didn't work. reason because safari not support cors (cross-origin resource sharing) videos going through webgl.

to clarify, if videos on same server application files work, because have files hosted on amazon s3 , cors. i'm unsure because have built application on digital ocean connects amazon s3 bucket, cannot afford droplet storage need(which around 100gb start , increase in future terrabytes , video collection gets bigger).

so know way can around make seem video not coming different origin or alternatively can past obstacle?

is there way set amazon s3 , amazon ec2 dont see each other cross-origin resource sharing?

edit:

i load videos this:

<script>  function showvideo(){     embedpano({          swf:"/krpano/krpano.swf",          xml:"/krpano/videopano.xml",          target:"pano",          html5:"only",      });  }  </script> 

this calls xml file calls video file:

<krpano>     <!-- add video sources , play video -->     <action name="add_video_sources">         videointerface_addsource(‘medium', 'https://s3-eu-west-1.amazonaws.com/myamazonbucket/shoots/2016/06/the-first-video/videos/high.mp4|https://s3-eu-west-1.amazonaws.com/myama…ideos/high.webm');         videointerface_play(‘medium');     </action> </krpano> 

i don't know how krpano core works, assume javascript gets urls xml file , makes request pull them in.

@datasage mentions in comments cloudfront common solution. don't know if thinking of work.

i described using solution solve different problem, in detail, on server fault. in case, question integrating main site , "/blog/*" different server under single domain name, making unified web site.

this same thing need, different reason.

create cloudfront distribution, setting alternate domain name site's name.

create 2 (or more) origin servers pointing dynamic , static content origin servers.

use 1 of them default, handling possible path patterns (*, default cache behavior) , carve out appropriate paths point other origin (e.g. /asset/* might point bucket, while default behavior points application itself).

in case, cloudfront being used other primary purpose cdn , instead, we're leveraging secondary purpose, using reverse proxy can selectively route requests multiple back-ends, based on path of request, without browser being aware there in fact multiple origins, because sits behind single hostname points cloudfront (which, obviously, you'll need point cloudfront in dns.)

the caching features can disabled if don't yet want/need/fully-understand them, particularly on requests application itself, disabling caching done selecting option forward request headers origin, in cache behavior sends requests application itself. objects in s3, sure you've set appropriate cache-control headers on objects when uploaded them, or can add them after uploading, using s3 console.

side bonus, using cloudfront allows enable ssl entire site, free ssl certificate amazon certificate manager (acm). certificate needs created in us-east-1 region of acm, regardless of bucket is, because region cloudfront uses when fetching cert acm. provisioning role only, , has no performance implications if bucket in region.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -