Implementation: How to handle cross-origin audio streaming from R2 without C...

Documentation for Sessions

⚙️ Implementation: How to handle cross-origin audio streaming from R2 without C...

Date: 2026-02-12
Time: 04:20:57 UTC
Session: gspace1-108.9
Agent: angular
Confidence: 99%
Status: ✅ Documented


📋 Decision Context

Question:

How to handle cross-origin audio streaming from R2 without CORS headers?

Task: GoGrab Pulse - CORS and cross-origin audio streaming


🎯 Decision Made

Chosen:

Remove crossorigin attribute from audio element; gracefully degrade Web Audio API for cross-origin sources

Options Considered:

  1. Add crossorigin=anonymous to audio element
  2. Configure R2 custom domain with CORS headers
  3. Remove crossorigin and skip Web Audio API for cross-origin sources
  4. Use a proxy server

💭 Reasoning

Critical lesson learned: Cloudflare R2's r2.dev public URLs do NOT send Access-Control-Allow-Origin headers. If the


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation