setCameraPosition method

Future<void> setCameraPosition(
  1. CameraPosition position
)

Implementation

Future<void> setCameraPosition(CameraPosition position) async {
  final options = currentOptions;
  if (options is! CameraCaptureOptions) {
    logger.warning('Not a camera track');
    return;
  }
  final newOptions = CameraCaptureOptions(
      cameraPosition: position,
      deviceId: null,
      maxFrameRate: options.maxFrameRate,
      params: options.params);
  await restartTrack(newOptions);
  await replaceTrackForMultiCodecSimulcast(mediaStreamTrack);
  currentOptions = newOptions;
}