Skip to content

Commit

Permalink
Merge pull request #34 from td-famedly/td/fixMCagain
Browse files Browse the repository at this point in the history
fix: tryCatch editing mediaConstraints
  • Loading branch information
cloudwebrtc authored Apr 23, 2024
2 parents bb6416b + c0a3820 commit b270bfb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/mediadevices_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ class MediaDevicesWeb extends MediaDevices {
mediaConstraints['video'].remove('facingMode');
}
}
mediaConstraints.putIfAbsent('video', () => false);
mediaConstraints.putIfAbsent('audio', () => false);
} catch (e) {
print(
'[getUserMedia] failed to remove facingMode from mediaConstraints');
}

mediaConstraints.putIfAbsent('video', () => false);
mediaConstraints.putIfAbsent('audio', () => false);

final mediaDevices = web.window.navigator.mediaDevices;

if (jsutil.hasProperty(mediaDevices, 'getUserMedia')) {
Expand Down

0 comments on commit b270bfb

Please sign in to comment.