Support RFB bell

The protocol handling was already there. What was missing was
hooking it up to a sound file in the user interface.
This commit is contained in:
Pierre Ossman 2016-09-19 15:15:07 +02:00
parent 33e1462999
commit 63bf2ba578
6 changed files with 21 additions and 0 deletions

4
app/sounds/CREDITS Normal file
View File

@ -0,0 +1,4 @@
bell
Copyright: Dr. Richard Boulanger et al
URL: http://www.archive.org/details/Berklee44v12
License: CC-BY Attribution 3.0 Unported

BIN
app/sounds/bell.mp3 Normal file

Binary file not shown.

BIN
app/sounds/bell.oga Normal file

Binary file not shown.

View File

@ -409,6 +409,10 @@ html {
color:green;
}
#noVNC_bell {
display: none;
}
/* ----------------------------------------
* Media sizing
* ----------------------------------------

View File

@ -205,6 +205,7 @@ var UI;
'onUpdateState': UI.updateState,
'onXvpInit': UI.updateXvpButton,
'onClipboard': UI.clipboardReceive,
'onBell': UI.bell,
'onFBUComplete': UI.initialResize,
'onFBResize': UI.updateViewDrag,
'onDesktopName': UI.updateDocumentTitle});
@ -1280,6 +1281,12 @@ var UI;
document.title = name + " - noVNC";
},
bell: function(rfb) {
if (WebUtil.getConfigVar('bell', 'on') === 'on') {
document.getElementById('noVNC_bell').play();
}
},
//Helper to add options to dropdown.
addOption: function(selectbox, text, value) {
var optn = document.createElement("OPTION");

View File

@ -218,6 +218,12 @@
</div>
</div>
<audio id="noVNC_bell">
<source src="app/sounds/bell.oga" type="audio/ogg">
<source src="app/sounds/bell.mp3" type="audio/mpeg">
</audio>
<!-- begin scripts -->
<script src="core/util.js"></script>
<script src="app/webutil.js"></script>