mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
GUACAMOLE-237: Define navigator.mediaDevices and getUserMedia when undefined.
This commit is contained in:
@@ -187,11 +187,15 @@ Guacamole.RawAudioRecorder = function RawAudioRecorder(stream, mimetype) {
|
|||||||
*
|
*
|
||||||
* @type Function
|
* @type Function
|
||||||
*/
|
*/
|
||||||
var getUserMedia = (navigator.mediaDevices.getUserMedia
|
|
||||||
|| navigator.getUserMedia
|
if (navigator.mediaDevices === undefined)
|
||||||
|| navigator.webkitGetUserMedia
|
navigator.mediaDevices = {};
|
||||||
|| navigator.mozGetUserMedia
|
|
||||||
|| navigator.msGetUserMedia).bind(navigator);
|
if (navigator.mediaDevices.getUserMedia === undefined)
|
||||||
|
navigator.mediaDevices.getUserMedia = (navigator.getUserMedia
|
||||||
|
|| navigator.webkitGetUserMedia
|
||||||
|
|| navigator.mozGetUserMedia
|
||||||
|
|| navigator.msGetUserMedia).bind(navigator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guacamole.ArrayBufferWriter wrapped around the audio output stream
|
* Guacamole.ArrayBufferWriter wrapped around the audio output stream
|
||||||
@@ -420,7 +424,7 @@ Guacamole.RawAudioRecorder = function RawAudioRecorder(stream, mimetype) {
|
|||||||
var beginAudioCapture = function beginAudioCapture() {
|
var beginAudioCapture = function beginAudioCapture() {
|
||||||
|
|
||||||
// Attempt to retrieve an audio input stream from the browser
|
// Attempt to retrieve an audio input stream from the browser
|
||||||
getUserMedia({ 'audio' : true }, function streamReceived(stream) {
|
navigator.mediaDevices.getUserMedia({ 'audio' : true }, function streamReceived(stream) {
|
||||||
|
|
||||||
// Create processing node which receives appropriately-sized audio buffers
|
// Create processing node which receives appropriately-sized audio buffers
|
||||||
processor = context.createScriptProcessor(BUFFER_SIZE, format.channels, format.channels);
|
processor = context.createScriptProcessor(BUFFER_SIZE, format.channels, format.channels);
|
||||||
|
Reference in New Issue
Block a user