From 3dfe5f2c445ab3707349a31806b20d2778549895 Mon Sep 17 00:00:00 2001 From: James Simpson Date: Fri, 1 Dec 2017 16:34:54 -0600 Subject: [PATCH] Replace deprecated gain.value with gain.setValueAtTime Fixes #856 --- src/howler.core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/howler.core.js b/src/howler.core.js index 3c2c4bb1..505002bc 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -81,7 +81,7 @@ // When using Web Audio, we just need to adjust the master gain. if (self.usingWebAudio) { - self.masterGain.gain.value = vol; + self.masterGain.gain.setValueAtTime(vol, Howler.ctx.currentTime); } // Loop through and change volume for all HTML5 audio nodes. @@ -123,7 +123,7 @@ // With Web Audio, we just need to mute the master gain. if (self.usingWebAudio) { - self.masterGain.gain.value = muted ? 0 : self._volume; + self.masterGain.gain.setValueAtTime(muted ? 0 : self._volume, tHowler.ctx.currentTime); } // Loop through and mute all HTML5 Audio nodes. @@ -2212,7 +2212,7 @@ // Create and expose the master GainNode when using Web Audio (useful for plugins or advanced usage). if (Howler.usingWebAudio) { Howler.masterGain = (typeof Howler.ctx.createGain === 'undefined') ? Howler.ctx.createGainNode() : Howler.ctx.createGain(); - Howler.masterGain.gain.value = Howler._muted ? 0 : 1; + Howler.masterGain.gain.setValueAtTime(Howler._muted ? 0 : 1, Howler.ctx.currentTime); Howler.masterGain.connect(Howler.ctx.destination); }