flutter-webrtc / dart-sip-ua

A dart-lang version of the SIP UA stack.
MIT License
331 stars 255 forks source link

Default Back Camera :( #370

Open alonenettr opened 1 year ago

alonenettr commented 1 year ago

Hello,

The back camera comes by default in iOS, how can I get it to come with the front camera?

VictorUvarov commented 1 year ago

use facingMode to default to back camera

final mediaConstraints = <String, dynamic>{
  'audio': true,
  'video': {
    'facingMode': 'user',
    'width': 1280,
    'height': 720,
  }
};
MediaStream mediaStream = await navigator.mediaDevices.getUserMedia(mediaConstraints);