Showing
1 changed file
with
3 additions
and
6 deletions
| @@ -106,18 +106,15 @@ class MobileScannerWebPlugin { | @@ -106,18 +106,15 @@ class MobileScannerWebPlugin { | ||
| 106 | Map? capabilities = | 106 | Map? capabilities = |
| 107 | html.window.navigator.mediaDevices?.getSupportedConstraints(); | 107 | html.window.navigator.mediaDevices?.getSupportedConstraints(); |
| 108 | if (capabilities != null && capabilities['facingMode']) { | 108 | if (capabilities != null && capabilities['facingMode']) { |
| 109 | - UserMediaOptions constraints = UserMediaOptions( | ||
| 110 | - video: VideoOptions( | 109 | + var constraints = VideoOptions( |
| 111 | facingMode: | 110 | facingMode: |
| 112 | (cameraFacing == CameraFacing.front ? 'user' : 'environment'), | 111 | (cameraFacing == CameraFacing.front ? 'user' : 'environment'), |
| 113 | width: {'ideal': 4096}, | 112 | width: {'ideal': 4096}, |
| 114 | height: {'ideal': 2160}, | 113 | height: {'ideal': 2160}, |
| 115 | - )); | 114 | + ); |
| 116 | 115 | ||
| 117 | - // test just using a raw map | ||
| 118 | - var videoConstraints = {'facingMode': cameraFacing == CameraFacing.front ? 'user' : 'environment'}; | ||
| 119 | _localStream = | 116 | _localStream = |
| 120 | - await html.window.navigator.getUserMedia(video: videoConstraints); | 117 | + await html.window.navigator.getUserMedia(video: constraints); |
| 121 | } else { | 118 | } else { |
| 122 | _localStream = await html.window.navigator.getUserMedia(video: true); | 119 | _localStream = await html.window.navigator.getUserMedia(video: true); |
| 123 | } | 120 | } |
-
Please register or login to post a comment