Skip to content

Instantly share code, notes, and snippets.

@angel-vladov
Created April 9, 2016 23:04
Show Gist options
  • Save angel-vladov/10c7d0f7995399bbb8fa2f6d2e558a79 to your computer and use it in GitHub Desktop.
Save angel-vladov/10c7d0f7995399bbb8fa2f6d2e558a79 to your computer and use it in GitHub Desktop.
Using createjs WebAudioPlugin with Phonegap (Cordova)
(function() {
'use strict';
var XHRRequest = createjs.XHRRequest;
var XHRRequest_checkError = XHRRequest.prototype._checkError;
XHRRequest.prototype._checkError = function () {
// Override of version 0.62 implementation
if ('cordova' in window) {
var status = parseInt(this._request.status);
switch (status) {
case 404: // Not Found
// case 0: arraybuffer load on mobile devices reports 0 but the load is ok
return new Error(status);
}
} else {
return XHRRequest_checkError.apply(this);
}
return null;
};
}) ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment