diff --git a/guacamole/src/main/webapp/app/client/types/ManagedClient.js b/guacamole/src/main/webapp/app/client/types/ManagedClient.js index fab359f37..64418e0b8 100644 --- a/guacamole/src/main/webapp/app/client/types/ManagedClient.js +++ b/guacamole/src/main/webapp/app/client/types/ManagedClient.js @@ -149,6 +149,15 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector', }; + /** + * The mimetype of audio data to be sent along the Guacamole connection if + * audio input is supported. + * + * @constant + * @type String + */ + ManagedClient.AUDIO_INPUT_MIMETYPE = 'audio/L16;rate=44100,channels=2'; + /** * Returns a promise which resolves with the string of connection * parameters to be passed to the Guacamole client during connection. This @@ -352,6 +361,12 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector', case 3: ManagedClientState.setConnectionState(managedClient.clientState, ManagedClientState.ConnectionState.CONNECTED); + + // Begin streaming audio input if possible + var stream = client.createAudioStream(ManagedClient.AUDIO_INPUT_MIMETYPE); + if (!Guacamole.AudioRecorder.getInstance(stream, ManagedClient.AUDIO_INPUT_MIMETYPE)) + stream.sendEnd(); + break; // Update history when disconnecting