diff --git a/guacamole-common-js/src/main/webapp/modules/AudioChannel.js b/guacamole-common-js/src/main/webapp/modules/AudioChannel.js index 10e56956e..3eb1dca86 100644 --- a/guacamole-common-js/src/main/webapp/modules/AudioChannel.js +++ b/guacamole-common-js/src/main/webapp/modules/AudioChannel.js @@ -121,7 +121,7 @@ Guacamole.AudioChannel.Packet = function(mimetype, data) { * @param {Number} when The time this packet should be played, in * milliseconds. */ - this.play = undefined; // Defined conditionally depending on support + this.play = function(when) { /* NOP */ }; // Defined conditionally depending on support // If audio API available, use it. if (Guacamole.AudioChannel.context) { @@ -181,57 +181,63 @@ Guacamole.AudioChannel.Packet = function(mimetype, data) { var play_on_load = false; // Create audio element to house and play the data - var audio = new Audio(); + var audio = null; + try { audio = new Audio(); } + catch (e) {} - // Read data and start decoding - var reader = new FileReader(); - reader.onload = function() { + if (audio) { - var binary = ""; - var bytes = new Uint8Array(reader.result); + // Read data and start decoding + var reader = new FileReader(); + reader.onload = function() { - // Produce binary string from bytes in buffer - for (var i=0; i