0

I want to change the volume on the fly, if I move the knob of the volume input. I have read a lot of posts and of course I googled.

document.getElementById('volume').addEventListener('change', function () {
   console.log(this.value);         
   video = document.getElementById('active');
   video.volume = this.value;
   //$('#active').prop("volume", this.value); //even this doesn't work.
});

With this code I can change the volume, when I do mouse up. But it won't change on the fly. How can I change on the fly? And main important why is it not working?

craphunter
  • 961
  • 2
  • 13
  • 34
  • if the control you're using doesn't fire events on each change you could possible trigger on a mouse move or a timer when the control has focus... – Offbeatmammal Nov 27 '14 at 21:17

1 Answers1

0

Take a look at this post:

Using jQuery to control HTML5 <audio> volume

Did you set the min/max volume already?

Community
  • 1
  • 1
rodrigogq
  • 1,943
  • 1
  • 16
  • 25