title: Angular2: Stream videos present in AWS S3 | Cross Origin error
body: <p>My application requires video files present in S3 to be played on frontend but seems like it is not able to read it. The error on browser console says:</p>
  
  <pre><code>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://s3-eu-west-1.amazonaws.com/mybucket/Oct17/myvideo.mov. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
  All candidate resources failed to load. Media load paused.
  </code></pre>
  
  <p>The component where am loading the video is:</p>
  
  <pre><code>&lt;video #media [vgMedia]="media" id="singleVideo" preload="auto" crossorigin&gt;
    &lt;source src="https://s3-eu-west-1.amazonaws.com/mybucket/Oct17/myvideo.mov" type="video/mp4"&gt;
  &lt;/video&gt;
  </code></pre>
  
  <p>Now, this is just one video but I have a db mapping which contains these S3 video urls which are upload using <code>awscli</code> copy command to a folder. There are plenty of videos under different folders inside <code>mybucket</code>. For one or two videos, am able to publish them using <code>AWS CloudFront</code> and when I give that URL under <code>src</code> attribute, the video plays fine.</p>
  
  <p>Any idea how to stream these videos via S3 url or how should I create the <code>CloudFront</code> url for all the videos uploaded?</p>