title: How to enable CORS for streaming on Chromecast using Media Player library?
body: <p>Chromecast supports streaming in MPEG-DASH, Smooth Streaming, and HLS and the Media Player library: <a href="https://developers.google.com/cast/docs/player" rel="noreferrer">https://developers.google.com/cast/docs/player</a> provides Javascript support for these kind of use cases.</p>
  
  <p>Since Streaming protocols, unlike most file based protocols, access content in an asynchronous way using XMLHTTPRequest, they are guarded against inappropriate access by the CORS header from the server where the resource originates.  </p>
  
  <p>It's been a recurring question regarding how to enable CORS for streaming on Chromecast in various environments such as dev, production, CDN, cloud hosted, etc.  It'd be great if the SO community can all pitch in to provide insights and share your experiences on this topic.</p>