remove action sounds

This commit is contained in:
Sravan 2024-12-13 09:33:44 +05:30
parent 52ddb20d25
commit 31e7e73e5f
2 changed files with 19 additions and 21 deletions

View File

@ -182,7 +182,6 @@ const UI = {
UI.initSetting('quality', 6); UI.initSetting('quality', 6);
UI.initSetting('compression', 2); UI.initSetting('compression', 2);
UI.initSetting('shared', true); UI.initSetting('shared', true);
UI.initSetting('bell', 'on');
UI.initSetting('view_only', false); UI.initSetting('view_only', false);
UI.initSetting('show_dot', false); UI.initSetting('show_dot', false);
UI.initSetting('path', 'websockify'); UI.initSetting('path', 'websockify');
@ -1088,7 +1087,6 @@ const UI = {
UI.rfb.addEventListener("clippingviewport", UI.updateViewDrag); UI.rfb.addEventListener("clippingviewport", UI.updateViewDrag);
UI.rfb.addEventListener("capabilities", UI.updatePowerButton); UI.rfb.addEventListener("capabilities", UI.updatePowerButton);
UI.rfb.addEventListener("clipboard", UI.clipboardReceive); UI.rfb.addEventListener("clipboard", UI.clipboardReceive);
UI.rfb.addEventListener("bell", UI.bell);
UI.rfb.addEventListener("desktopname", UI.updateDesktopName); UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
UI.rfb.clipViewport = UI.getSetting('view_clip'); UI.rfb.clipViewport = UI.getSetting('view_clip');
UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale'; UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
@ -1764,23 +1762,23 @@ const UI = {
document.title = e.detail.name + " - " + PAGE_TITLE; document.title = e.detail.name + " - " + PAGE_TITLE;
}, },
bell(e) { // bell(e) {
if (UI.getSetting('bell') === 'on') { // if (UI.getSetting('bell') === 'on') {
const promise = document.getElementById('noVNC_bell').play(); // const promise = document.getElementById('noVNC_bell').play();
// The standards disagree on the return value here // // The standards disagree on the return value here
if (promise) { // if (promise) {
promise.catch((e) => { // promise.catch((e) => {
if (e.name === "NotAllowedError") { // if (e.name === "NotAllowedError") {
// Ignore when the browser doesn't let us play audio. // // Ignore when the browser doesn't let us play audio.
// It is common that the browsers require audio to be // // It is common that the browsers require audio to be
// initiated from a user action. // // initiated from a user action.
} else { // } else {
Log.Error("Unable to play bell: " + e); // Log.Error("Unable to play bell: " + e);
} // }
}); // });
} // }
} // }
}, // },
//Helper to add options to dropdown. //Helper to add options to dropdown.
addOption(selectbox, text, value) { addOption(selectbox, text, value) {

View File

@ -383,9 +383,9 @@
autocomplete="off" spellcheck="false" tabindex="-1"></textarea> autocomplete="off" spellcheck="false" tabindex="-1"></textarea>
</div> </div>
<audio id="noVNC_bell"> <!-- <audio id="noVNC_bell">
<source src="app/sounds/bell.oga" type="audio/ogg"> <source src="app/sounds/bell.oga" type="audio/ogg">
<source src="app/sounds/bell.mp3" type="audio/mpeg"> <source src="app/sounds/bell.mp3" type="audio/mpeg">
</audio> </audio> -->
</body> </body>
</html> </html>