CORS - The problem I didn't know I had
After beating my head for over a week, I stumbled upon this site today…
I’ve been fighting with a site that features audio clips (in addition to other media) that needed to operate on desktop and iPad devices. Everything to-date seemed to have been working fine, but reports of faulty audio-playback on iPad started a terrible down-hill battle.
After trying several HTML5/Flash-fallback audio players, JavaScript configurations, media re-encoding, media encoding in multiple formats, and I’m sure something else, I wondered about the fact that I was referencing a file on a production url while I was testing on a staging site. (I think I hear Flash developers screaming, “Duhhhh”)
However, my attempt at adding a crossdomain.xml file was futile. But that got me looking. It became very likely, in my head, that a mobile device should not pull foreign content without permission; which brought me to Cross-Origin Resource Sharing. I’ts a lovely little source of knowledge that allowed one line in a .htaccess file on the production site to solve the problem I didn’t even know I had. Beautiful.
