In Oracle Analytics, users sometimes experience issues displaying media content, such as images and videos, in their visualizations, particularly when the media file is referenced using a URL. This article outlines a quick and effective solution to address these issues, especially when the media content is hosted on Oracle Cloud Infrastructure (OCI) Object Storage.

Visualizations that render images/videos in OAC
Image 1: Visualizations Displaying Images or Videos in OAC

To ensure media files display correctly in Oracle Analytics visualizations (such as Image) or custom plug-ins (such as Image Gallery Viz, Vision Viz, and Video Viz), the source URLs must explicitly to allow Cross-Origin Resource Sharing (CORS).

Step-by-Step: Allow CORS through Object Metadata

When you upload media files to an OCI Object Storage bucket, you must configure the correct metadata headers that permit CORS access. 
If you’re uploading files for the first time, see also Uploading Objects to a Bucket.

  1. In the Upload Objects screen, click Show Optional Response Headers and Metadata
    Upload Objects screen in OCI Object Storage
    Image 2: Upload Objects dialog
  2.  Under the Type column, select Metadata.
    Add metadata header to uploading objects.
    Image 3: Show Optional Response Headers and Metadata
  3. In the Name field, enter:

    Content-Security-Policy
  4. In the Value field, enter the appropriate CORS directive based on the file type:

           For image files:

           img-src self https://<your-namespace>.objectstorage.<region>.oraclecloud.com/

           For video files:

           media-src self https://<your-namespace>.objectstorage.<region>.oraclecloud.com/

           Replace <your-namespace> and <region> with your actual OCI tenancy and region details.

 

Important Notes

•    Metadata settings apply to all the files you upload during the session.
•    After you upload a file, you can’t edit or delete the metadata configuration  through the OCI Console, so it’s important to set the correct metadata before submission.
•    Additionally, ensure you include the source domain (your Object Storage URL) in the Safe Domains list for Oracle Analytics. Without this, even correctly configured CORS settings may not allow your media files to display in visualizations. See Register Safe Domains.

Summary

When you set the correct CORS policy on your OCI-hosted media files, you can seamlessly render images and videos within Oracle Analytics visualizations—enhancing your dashboards with rich, interactive content.

Call to Action

Now that you’ve read this post, try it yourself and let us know your results in the Oracle Analytics Community, where you can also ask questions and post ideas.