Cross Origin Resource Sharing (CORS) allows interactions between resources from
different origins, something that is normally prohibited in order to prevent
malicious behavior. This page explains how to configure CORS on a
Cloud Storage bucket for a sample origin, the origin of the online
[Shaka](https://shaka-player-demo.appspot.com/demo/) media player.

> [!NOTE]
> **Note:** Enabling cross-origin resource sharing is not necessary to use the Transcoder API, but you can use this guide to set up storage buckets so that you can review content from web-based players.

To [enable cross-origin resource
sharing (CORS) on a Cloud Storage bucket](https://docs.cloud.google.com/storage/docs/using-cors#configure-cors-bucket), do the following:

1. Create a JSON file that contains the following:

   ```
   [
     {
       "origin": ["https://shaka-player-demo.appspot.com/"],
       "responseHeader": ["Content-Type", "Range"],
       "method": ["GET", "HEAD"],
       "maxAgeSeconds": 3600
     }
   ]
   ```
2. Run the following command after replacing <var translate="no">JSON_FILE_NAME</var> with the name of the JSON file you created in the previous step:

   ```
   gcloud storage buckets update gs://STORAGE_BUCKET_NAME --cors-file=JSON_FILE_NAME.json
   ```