Procházet zdrojové kódy

fix: set gain retroactively

Sv443 před 1 rokem
rodič
revize
095b53474e
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/dom.ts

+ 1 - 1
lib/dom.ts

@@ -172,7 +172,7 @@ export function amplifyMedia<TElem extends HTMLMediaElement>(mediaElement: TElem
     gainNode: context.createGain(),
     gainNode: context.createGain(),
     /** Sets the gain of the amplifying GainNode */
     /** Sets the gain of the amplifying GainNode */
     setGain(gain: number) {
     setGain(gain: number) {
-      props.gainNode.gain.setValueAtTime(gain, context.currentTime);
+      props.gainNode.gain.value = gain;
     },
     },
     /** Returns the current gain of the amplifying GainNode */
     /** Returns the current gain of the amplifying GainNode */
     getGain() {
     getGain() {