I’m building an app using Sencha Touch and PhoneGap (aka Apache Cordova). I’m trying to play audio from an external domain with Sencha’s Ext.Audio element (which creates an HTML5 audio element in the DOM) in response to a tap event.
In desktop versions of Chrome and Safari, this works fine. When I run the project as a “native” app on the iPhone, the audio will not play, but Xcode’s console doesn’t show any errors.
Using the same Ext.Audio.play() method, and the same audio file, but including the file in the app rather than loading it from an external server, it also plays.
Is this a cross-domain restriction? Does anyone know a way around it?
This appears to have been an HTTP header issue. Apparently the UIWebView is more finicky about that than desktop browsers. Not sure, but I changed the way the files were being served by the host, and it started working.