RTCMultiConnection Docs

RTCMultiConnection API Reference / "selectDevices"

  1. You can get list of devices using "getDevices" method and prefer any single or two audio/video devices using "selectDevices" method.
  2. // get list of devices
    connection.getDevices(function(devices){
        for (var device in devices) {
            device = devices[device];
            
            // device.kind == 'audio' || 'video'
            console.log(device.id, device.label);
        }
    });
    
    // select any audio and/or video device
    connection.selectDevices(firstDeviceID, secondDeviceID);
    
  3. selectDevices takes two arguments. One for selecting "audio" input device; and other one for selecting "video" input device.
  4. Remember, selectDevices's both arguments are optional.
  5. // following call has no meanings!
    connection.selectDevices();
    
    // selecting single device
    connection.selectDevices(audioDevice);
    connection.selectDevices(videoDevice);
    
    // following two calls are identical!
    connection.selectDevices(audioDevice, videoDevice);
    connection.selectDevices(videoDevice, audioDevice);
    
  6. Caution: You can pass only "id" of the audio/video input device.


Want to ask a Question?

You can include your email for private conversation!