Created
April 9, 2016 23:04
-
-
Save angel-vladov/10c7d0f7995399bbb8fa2f6d2e558a79 to your computer and use it in GitHub Desktop.
Using createjs WebAudioPlugin with Phonegap (Cordova)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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