GUAC-1212: Add try/catch block to creation of AudioContext

This commit is contained in:
Stephen Young
2015-05-26 13:49:09 -06:00
parent 1e0f194126
commit f08dbacdb2

View File

@@ -71,12 +71,14 @@ Guacamole.AudioChannel = function() {
// Define context if available // Define context if available
if (window.AudioContext) { if (window.AudioContext) {
Guacamole.AudioChannel.context = new AudioContext(); try {Guacamole.AudioChannel.context = new AudioContext();}
catch (e){}
} }
// Fallback to Webkit-specific AudioContext implementation // Fallback to Webkit-specific AudioContext implementation
else if (window.webkitAudioContext) { else if (window.webkitAudioContext) {
Guacamole.AudioChannel.context = new webkitAudioContext(); try {Guacamole.AudioChannel.context = new webkitAudioContext();}
catch (e){}
} }
/** /**