Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove sound, control bar #1923

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions core/rfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2464,10 +2464,10 @@ export default class RFB extends EventTargetMixin {
return this._handleSetColourMapMsg();

case 2: // Bell
Log.Debug("Bell");
this.dispatchEvent(new CustomEvent(
"bell",
{ detail: {} }));
// Log.Debug("Bell");
// this.dispatchEvent(new CustomEvent(
// "bell",
// { detail: {} }));
return true;

case 3: // ServerCutText
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>