// Infinite event listener (promise is never resolved)
// Infinite event listener (promise is never resolved)
// eventListener is removed when promise is cancelled/rejected
// eventListener is removed when promise is cancelled/rejected
...
@@ -66,12 +66,6 @@
...
@@ -66,12 +66,6 @@
gadget.filter.connect(gadget.analyser);
gadget.filter.connect(gadget.analyser);
gadget.analyser.connect(gadget.gain);
gadget.analyser.connect(gadget.gain);
gadget.gain.connect(audioCtx.destination);
gadget.gain.connect(audioCtx.destination);
gadget.audio.src=url;
gadget.audio.load();
if(gadget.type==="video/webm"){
gadget.video.src=url;
gadget.video.load();
}
}
}
functionpromiseRequestAnimation(callback){
functionpromiseRequestAnimation(callback){
varanimationId,callback_promise;
varanimationId,callback_promise;
...
@@ -98,7 +92,7 @@
...
@@ -98,7 +92,7 @@
}
}
functionplay(){
functionplay(){
varthat=this,canvas=that.canvas,canvasCtx=canvas.getContext("2d"),cwidth=canvas.width,cheight=canvas.height-2,meterWidth=8,//width of the meters in the spectrum
varthat=this,canvas=that.canvas,canvasCtx=canvas.getContext("2d"),cwidth=canvas.width,cheight=canvas.height-2,meterWidth=8,//width of the meters in the spectrum