From 6026b14a0f57a941e7c1a41be92d60d4aab78603 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 21 Oct 2012 15:48:07 -0700 Subject: [PATCH] Add audio/video/size event functions. --- .../src/main/resources/guacamole.js | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index a1a196062..7ffbefe7f 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -320,6 +320,52 @@ Guacamole.Client = function(tunnel) { return bounds; }; + /** + * Sends a supported audio mimetype. + * + * @param {String} mimetype The supported mimetype to send. + */ + this.sendAudioMimetype = function(mimetype) { + + // Do not send requests if not connected + if (!isConnected()) + return; + + tunnel.sendMessage("audio", mimetype); + + }; + + /** + * Sends a supported video mimetype. + * + * @param {String} mimetype The supported mimetype to send. + */ + this.sendVideoMimetype = function(mimetype) { + + // Do not send requests if not connected + if (!isConnected()) + return; + + tunnel.sendMessage("video", mimetype); + + }; + + /** + * Sends the current size of the screen. + * + * @param {Number} width The width of the screen. + * @param {Number} height The height of the screen. + */ + this.sendSize = function(width, height) { + + // Do not send requests if not connected + if (!isConnected()) + return; + + tunnel.sendMessage("size", width, height); + + }; + /** * Sends a key event having the given properties as if the user * pressed or released a key.