try catch audio
parent
dc1fdba3c3
commit
91fbb1bbab
|
@ -76,6 +76,7 @@ R3.D3.Audio.prototype.createInstance = function() {
|
|||
if (document.documentMode || /Edge/.test(navigator.userAgent)) {
|
||||
R3.Component.prototype.createInstance.call(this);
|
||||
} else {
|
||||
try {
|
||||
audioLoader.load(
|
||||
this.apiUrl + this.path + '?ts=' + Date.now(),
|
||||
function (buffer) {
|
||||
|
@ -88,6 +89,10 @@ R3.D3.Audio.prototype.createInstance = function() {
|
|||
R3.Component.prototype.createInstance.call(this);
|
||||
}.bind(this)
|
||||
);
|
||||
} catch (error) {
|
||||
console.warn('failed to load audio - does it exist? : ' + error.message || 'unknown reason');
|
||||
R3.Component.prototype.createInstance.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue