diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index 6076a5f3b..5ffaee0a9 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -273,6 +273,9 @@ Guacamole.Client = function(tunnel) { // No initial parsers var parsers = []; + // No initial audio channels + var audio_channels = []; + tunnel.onerror = function(message) { if (guac_client.onerror) guac_client.onerror(message); @@ -528,6 +531,18 @@ Guacamole.Client = function(tunnel) { } + function getAudioChannel(index) { + + var audio_channel = audio_channels[index]; + + // If audio channel not yet created, create it + if (audio_channel == null) + audio_channel = audio_channels[index] = new Guacamole.AudioChannel(); + + return audio_channel; + + } + /** * Handlers for all defined layer properties. * @private @@ -561,6 +576,17 @@ Guacamole.Client = function(tunnel) { }, + "audio": function(parameters) { + + var channel = getAudioChannel(parseInt(parameters[0])); + var mimetype = parameters[1]; + var duration = parseInt(parameters[2]); + var data = parameters[3]; + + channel.play(mimetype, duration, data); + + }, + "cfill": function(parameters) { var channelMask = parseInt(parameters[0]);