From 3bc46a2d6fdf319f657cbffeced0c2174f223499 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Thu, 18 Jan 2018 14:01:41 +0100 Subject: [PATCH] fuck audio for microdummies --- src/game-lib-d3-audio.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/game-lib-d3-audio.js b/src/game-lib-d3-audio.js index 5967f57..257a4d1 100644 --- a/src/game-lib-d3-audio.js +++ b/src/game-lib-d3-audio.js @@ -80,19 +80,23 @@ GameLib.D3.Audio.prototype.createInstance = function() { console.log('loading audio : ' + this.name); - //Load a sound and set it as the Audio object's buffer - audioLoader.load( - this.apiUrl + this.path + '?ts=' + Date.now(), - function( buffer ) { + if (document.documentMode || /Edge/.test(navigator.userAgent)) { + GameLib.Component.prototype.createInstance.call(this); + } else { + audioLoader.load( + this.apiUrl + this.path + '?ts=' + Date.now(), + function (buffer) { - console.log('loaded audio: ' + this.name); + console.log('loaded audio: ' + this.name); + + this.instance.setBuffer(buffer); + this.instance.setLoop(this.loop); + this.instance.setVolume(this.volume); + GameLib.Component.prototype.createInstance.call(this); + }.bind(this) + ); + } - this.instance.setBuffer( buffer ); - this.instance.setLoop( this.loop ); - this.instance.setVolume( this.volume ); - GameLib.Component.prototype.createInstance.call(this); - }.bind(this) - ); }; /**