Daniel Newton

fix camerafacing conversion

@@ -80,8 +80,9 @@ class MobileScannerWebPlugin { @@ -80,8 +80,9 @@ class MobileScannerWebPlugin {
80 Future<Map> _start(arguments) async { 80 Future<Map> _start(arguments) async {
81 vidDiv.children = [video]; 81 vidDiv.children = [video];
82 82
83 - final CameraFacing cameraFacing =  
84 - arguments['facing'] ?? CameraFacing.front; 83 + var cameraFacing = CameraFacing.front;
  84 + if (arguments.containsKey('facing'))
  85 + cameraFacing = CameraFacing.values[arguments['facing']];
85 86
86 // See https://github.com/flutter/flutter/issues/41563 87 // See https://github.com/flutter/flutter/issues/41563
87 // ignore: UNDEFINED_PREFIXED_NAME 88 // ignore: UNDEFINED_PREFIXED_NAME
@@ -116,7 +117,6 @@ class MobileScannerWebPlugin { @@ -116,7 +117,6 @@ class MobileScannerWebPlugin {
116 _localStream = 117 _localStream =
117 await html.window.navigator.getUserMedia(video: constraints); 118 await html.window.navigator.getUserMedia(video: constraints);
118 } else { 119 } else {
119 - debugPrint('no facingMode capabilities :(');  
120 _localStream = await html.window.navigator.getUserMedia(video: true); 120 _localStream = await html.window.navigator.getUserMedia(video: true);
121 } 121 }
122 122