Using jQuery to control HTML5 <audio> volume

后端 未结 4 1351
你的背包
你的背包 2020-11-28 15:16

Okay, I want to control the volume of an HTML5 element using the jQuery Slider element. I have implemented the slide, but can\'t figure out how to make the value of the slid

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 16:15

    This can also be achieved with a simple input range element, without using jQuery-UI.

    
    
    
    let audioStream = new Audio('https://mofosounds.com:8000/;');
    
    $("#volumeSlider").change(function(){
        let volume = $(this).val();
        audioStream.volume = volume ;
    });
    

提交回复
热议问题