-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvolumecontroller.js
1 lines (1 loc) · 1.54 KB
/
volumecontroller.js
1
javascript:var g_6z; function cI_6z(){ var ctx_6z = new AudioContext(); var el_6z = document.querySelector("video") ? document.querySelector("video") : document.querySelector("audio")? document.querySelector("audio"):alert(%27Media DOM not exist. Aborting.%27); if (el_6z){ g_6z = ctx_6z.createGain(); g_6z.gain.value = 1; var src_6z = ctx_6z.createMediaElementSource(el_6z); src_6z.connect(g_6z).connect(ctx_6z.destination); var p = document.createElement("div"); p.innerHTML = `<div class=vpc_6z id=vpc_6z><style>.vpc_6z{float:right;width:25%;position:fixed;bottom:0;padding:20px 20px;z-index:9999999;background:#444;color:#fff}.vpc_6z-hide{position:fixed;background:#444;padding:0;width:80px;height:30px;bottom:0;z-index:999999}.vpi_6z-hide{display:none}</style><button onclick='d=document.getElementById("vpi_6z"),"vpi_6z"==d.getAttribute("class")?d.setAttribute("class","vpi_6z-hide"):d.setAttribute("class","vpi_6z"),c=document.getElementById("vpc_6z"),"vpc_6z"==c.getAttribute("class")?c.setAttribute("class","vpc_6z-hide"):c.setAttribute("class","vpc_6z")'style=float:right;cursor:pointer;width:80px;height:30px>Toggle VP</button><div class=vpi_6z id=vpi_6z><button onclick='document.getElementById("vpc_6z").remove()'>Destroy Panel</button><h1>Volume Gain: <span id=volumeControl_e></span></h1><input max=100 min=1 onchange='v=this.value,cG_6z(v),document.getElementById("volumeControl_e").innerHTML=1*v+100,console.log(v)'style=width:100% type=range value=1></div></div>%60; document.body.appendChild(p); } }; function cG_6z(v){ g_6z.gain.value = v; }; cI_6z(1);