setVideoDevice method

Future<void> setVideoDevice(
  1. DeviceDetails device
)

Sets the provided device as a currently used videoDevice.

Does nothing if device is already the videoDevice.

Implementation

Future<void> setVideoDevice(DeviceDetails device) async {
  Log.debug('setVideoDevice($device)', '$runtimeType');

  if ((videoDevice.value != null && device != videoDevice.value) ||
      (videoDevice.value == null &&
          devices.video().firstOrNull?.deviceId() != device.deviceId())) {
    await _updateSettings(videoDevice: device);
  }
}