Remembering the camera and microphone selection

For security in pages loaded over HTTP, all browsers always prompt the user to select the camera and microphone used to publish a stream.

In pages loaded over HTTPS in Chrome, the user's camera and microphone selection is remembered and reused on subsequent visits to a page loaded from the same HTTPS domain.

In pages loaded over HTTPS in Firefox, the user has an option to remember the camera and microphone (in subsequent visits to a page loaded from the same HTTPS domain) when selecting the devices.

In pages loaded over HTTPS in IE, you can use the user's previous camera and microphone selection from previous usage to the same HTTPS domain (if there was any), by setting the usePreviousDeviceSelection property to true in the options you pass into the OT.initPublisher() method:

var pubOptions = {usePreviousDeviceSelection: true};
var publisher = OT.initPublisher(null, pubOptions, function(error) {
  console.log("OT.initPublisher error: ", error);
});

To prompt the user to select the camera and microphone to use in IE (and ignore previous device selections), do not set the usePreviousDevices property in the options you pass into the OT.initPublisher() method (or set it to false, the default).

Using the front- or back-facing camera

When you initialize a publisher, you can set the facingMode property of the options object you pass into the OT.initPublisher(). For example, you can set the property to "user" (front-facing camera) or "environment" (rear-facing camera), when this option is available on the client's system. (Generally, these options are available on mobile devices only.)

If you set the facingMode option, do not set the videoSource property.

Disabling default audio input device management

By default, the SDK automatically handles the audio input device switching if there was a new one plugged in. This might not be the desired behavior for some end users that would like to keep the selection of their current microphone.

As an advanced user of the SDK, you can disable automatic audio input device management. You can do so by setting the disableAudioInputDeviceManagement property to the options passed into the OT.initPublisher() method:

var pubOptions = {disableAudioInputDeviceManagement: true};
var publisher = OT.initPublisher(null, pubOptions, function(error) {
  console.log("Publishing a stream");
});

Note: This is an advanced feature. If you enable this, the audio input device used by the SDK will not be updated when the end user changes their microphone.

Note: This is a beta feature.