Skip to content

Commit b270bfb

Browse files
authored
Merge pull request #34 from td-famedly/td/fixMCagain
fix: tryCatch editing mediaConstraints
2 parents bb6416b + c0a3820 commit b270bfb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/src/mediadevices_impl.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ class MediaDevicesWeb extends MediaDevices {
2020
mediaConstraints['video'].remove('facingMode');
2121
}
2222
}
23+
mediaConstraints.putIfAbsent('video', () => false);
24+
mediaConstraints.putIfAbsent('audio', () => false);
2325
} catch (e) {
2426
print(
2527
'[getUserMedia] failed to remove facingMode from mediaConstraints');
2628
}
2729

28-
mediaConstraints.putIfAbsent('video', () => false);
29-
mediaConstraints.putIfAbsent('audio', () => false);
30-
3130
final mediaDevices = web.window.navigator.mediaDevices;
3231

3332
if (jsutil.hasProperty(mediaDevices, 'getUserMedia')) {

0 commit comments

Comments
 (0)