From 18dc968fb66087fc45b12e6a8b05fa274a939f42 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 29 Jul 2025 10:11:43 -0400 Subject: real-time volume --- player.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/player.mjs b/player.mjs index 070eadf..6a4e39a 100644 --- a/player.mjs +++ b/player.mjs @@ -30,10 +30,9 @@ export default class extends HTMLElement { this.globalGain.connect(this.audioCtx.destination); this.globalGain.gain.setValueAtTime(this.volume, this.audioCtx.currentTime); - this.querySelector('.volume').onchange = e => { - console.debug('vol changed', e, this.volume); + this.querySelector('.volume').addEventListener('input', _ => { this.globalGain.gain.setValueAtTime(this.volume, this.audioCtx.currentTime); - } + }); } get volume() { -- cgit v1.3