forked from server/soundboard
added kill audio support for local playback
This commit is contained in:
parent
55e8e04bb2
commit
cd933addf7
@ -66,11 +66,7 @@ ready(function() {
|
||||
resetSearch();
|
||||
} else if ((evt.keyCode == 75 || evt.keyCode == 67) && evt.ctrlKey) {
|
||||
// ctrl+k and ctrl+c key binding
|
||||
if (localModeEnabled) {
|
||||
killAllHowlerAudio();
|
||||
} else {
|
||||
ajaxRequest("/?killvideo=yes");
|
||||
}
|
||||
killAllAudio();
|
||||
} else if (evt.keyCode == 88 && evt.ctrlKey){
|
||||
toggleLocalMode();
|
||||
}
|
||||
@ -85,7 +81,7 @@ ready(function() {
|
||||
// keylistener for enter or ctrl+enter (which is k10 on chrome)
|
||||
if (key === 13 || (key === 10 && e.ctrlKey)) {
|
||||
if(e.ctrlKey){
|
||||
ajaxRequest("/?killvideo=yes");
|
||||
killAllAudio();
|
||||
await sleep(100);
|
||||
}
|
||||
source.classList.add("sound-pressed");
|
||||
@ -172,3 +168,11 @@ function killAllHowlerAudio(){
|
||||
}
|
||||
}
|
||||
|
||||
function killAllAudio(){
|
||||
if (localModeEnabled) {
|
||||
killAllHowlerAudio();
|
||||
} else {
|
||||
ajaxRequest("/?killvideo=yes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
</form>
|
||||
<button onclick="playStream();">Play!</button>
|
||||
</div>
|
||||
<button name="submit" onclick="ajaxRequest('/?killvideo=yes');">Terminate videos</button>
|
||||
<button name="submit" onclick="killAllAudio();">Terminate videos</button>
|
||||
</section>
|
||||
<section id="voice" style="display:none;">
|
||||
<form action="/say/" method="POST">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user