openCamera static method

Future<MediaStream> openCamera(
  1. Map<String, dynamic> mediaConstraints
)

To select a a specific camera, you need to set constraints eg. var constraints = { 'audio': true, 'video': { 'deviceId': Helper.cameras0.deviceId, } };

var stream = await Helper.openCamera(constraints);

Implementation

static Future<MediaStream> openCamera(Map<String, dynamic> mediaConstraints) {
  return navigator.mediaDevices.getUserMedia(mediaConstraints);
}