Skip to content

Commit

Permalink
remove action sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
sravan-abacus committed Dec 13, 2024
1 parent 52ddb20 commit 31e7e73
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
36 changes: 17 additions & 19 deletions app/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ const UI = {
UI.initSetting('quality', 6);
UI.initSetting('compression', 2);
UI.initSetting('shared', true);
UI.initSetting('bell', 'on');
UI.initSetting('view_only', false);
UI.initSetting('show_dot', false);
UI.initSetting('path', 'websockify');
Expand Down Expand Up @@ -1088,7 +1087,6 @@ const UI = {
UI.rfb.addEventListener("clippingviewport", UI.updateViewDrag);
UI.rfb.addEventListener("capabilities", UI.updatePowerButton);
UI.rfb.addEventListener("clipboard", UI.clipboardReceive);
UI.rfb.addEventListener("bell", UI.bell);
UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
UI.rfb.clipViewport = UI.getSetting('view_clip');
UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
Expand Down Expand Up @@ -1764,23 +1762,23 @@ const UI = {
document.title = e.detail.name + " - " + PAGE_TITLE;
},

bell(e) {
if (UI.getSetting('bell') === 'on') {
const promise = document.getElementById('noVNC_bell').play();
// The standards disagree on the return value here
if (promise) {
promise.catch((e) => {
if (e.name === "NotAllowedError") {
// Ignore when the browser doesn't let us play audio.
// It is common that the browsers require audio to be
// initiated from a user action.
} else {
Log.Error("Unable to play bell: " + e);
}
});
}
}
},
// bell(e) {
// if (UI.getSetting('bell') === 'on') {
// const promise = document.getElementById('noVNC_bell').play();
// // The standards disagree on the return value here
// if (promise) {
// promise.catch((e) => {
// if (e.name === "NotAllowedError") {
// // Ignore when the browser doesn't let us play audio.
// // It is common that the browsers require audio to be
// // initiated from a user action.
// } else {
// Log.Error("Unable to play bell: " + e);
// }
// });
// }
// }
// },

//Helper to add options to dropdown.
addOption(selectbox, text, value) {
Expand Down
4 changes: 2 additions & 2 deletions vnc.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ <h1 class="noVNC_logo" translate="no"><span>no</span><br>VNC</h1>
autocomplete="off" spellcheck="false" tabindex="-1"></textarea>
</div>

<audio id="noVNC_bell">
<!-- <audio id="noVNC_bell">
<source src="app/sounds/bell.oga" type="audio/ogg">
<source src="app/sounds/bell.mp3" type="audio/mpeg">
</audio>
</audio> -->
</body>
</html>

0 comments on commit 31e7e73

Please sign in to comment.