createCameraTrack static method

Future<LocalVideoTrack> createCameraTrack(
  1. [CameraCaptureOptions? options]
)

Creates a LocalVideoTrack from camera input.

Implementation

static Future<LocalVideoTrack> createCameraTrack([
  CameraCaptureOptions? options,
]) async {
  options ??= const CameraCaptureOptions();

  final stream = await LocalTrack.createStream(options);
  return LocalVideoTrack._(
    TrackSource.camera,
    stream,
    stream.getVideoTracks().first,
    options,
  );
}