diff --git a/static/main.js b/static/main.js
index 4ad2b7d..d80a766 100644
--- a/static/main.js
+++ b/static/main.js
@@ -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");
+ }
+}
+
diff --git a/templates/index.html b/templates/index.html
index f2f56bf..3e31879 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -53,7 +53,7 @@
-
+