Showing
1 changed file
with
5 additions
and
3 deletions
| @@ -89,7 +89,7 @@ class MobileScannerWeb extends MobileScannerPlatform { | @@ -89,7 +89,7 @@ class MobileScannerWeb extends MobileScannerPlatform { | ||
| 89 | Future<MediaStream> _prepareVideoStream( | 89 | Future<MediaStream> _prepareVideoStream( |
| 90 | CameraFacing cameraDirection, | 90 | CameraFacing cameraDirection, |
| 91 | ) async { | 91 | ) async { |
| 92 | - if ((window.navigator.mediaDevices as JSAny?).isUndefinedOrNull) { | 92 | + if (window.navigator.mediaDevices.isUndefinedOrNull) { |
| 93 | throw const MobileScannerException( | 93 | throw const MobileScannerException( |
| 94 | errorCode: MobileScannerErrorCode.unsupported, | 94 | errorCode: MobileScannerErrorCode.unsupported, |
| 95 | errorDetails: MobileScannerErrorDetails( | 95 | errorDetails: MobileScannerErrorDetails( |
| @@ -104,7 +104,7 @@ class MobileScannerWeb extends MobileScannerPlatform { | @@ -104,7 +104,7 @@ class MobileScannerWeb extends MobileScannerPlatform { | ||
| 104 | 104 | ||
| 105 | final MediaStreamConstraints constraints; | 105 | final MediaStreamConstraints constraints; |
| 106 | 106 | ||
| 107 | - if ((capabilities as JSAny).isUndefinedOrNull || !capabilities.facingMode) { | 107 | + if (capabilities.isUndefinedOrNull || !capabilities.facingMode) { |
| 108 | constraints = MediaStreamConstraints(video: true.toJS); | 108 | constraints = MediaStreamConstraints(video: true.toJS); |
| 109 | } else { | 109 | } else { |
| 110 | final String facingMode = switch (cameraDirection) { | 110 | final String facingMode = switch (cameraDirection) { |
| @@ -113,7 +113,9 @@ class MobileScannerWeb extends MobileScannerPlatform { | @@ -113,7 +113,9 @@ class MobileScannerWeb extends MobileScannerPlatform { | ||
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | constraints = MediaStreamConstraints( | 115 | constraints = MediaStreamConstraints( |
| 116 | - video: MediaTrackConstraintSet(facingMode: facingMode.toJS) as JSAny, | 116 | + video: MediaTrackConstraintSet( |
| 117 | + facingMode: facingMode.toJS, | ||
| 118 | + ), | ||
| 117 | ); | 119 | ); |
| 118 | } | 120 | } |
| 119 | 121 |
-
Please register or login to post a comment