Showing
1 changed file
with
14 additions
and
2 deletions
| @@ -138,6 +138,12 @@ final class ZXingBarcodeReader extends BarcodeReader { | @@ -138,6 +138,12 @@ final class ZXingBarcodeReader extends BarcodeReader { | ||
| 138 | final JSPromise? result = _reader?.attachStreamToVideo.callAsFunction(null, stream, videoElement) as JSPromise?; | 138 | final JSPromise? result = _reader?.attachStreamToVideo.callAsFunction(null, stream, videoElement) as JSPromise?; |
| 139 | 139 | ||
| 140 | await result?.toDart; | 140 | await result?.toDart; |
| 141 | + | ||
| 142 | + final web.MediaTrackConstraints? constraints = _mediaTrackConstraintsDelegate.getConstraints(stream); | ||
| 143 | + | ||
| 144 | + if (constraints != null) { | ||
| 145 | + _onMediaTrackConstraintsChanged?.call(constraints); | ||
| 146 | + } | ||
| 141 | } | 147 | } |
| 142 | } | 148 | } |
| 143 | 149 | ||
| @@ -192,7 +198,7 @@ final class ZXingBarcodeReader extends BarcodeReader { | @@ -192,7 +198,7 @@ final class ZXingBarcodeReader extends BarcodeReader { | ||
| 192 | } | 198 | } |
| 193 | 199 | ||
| 194 | @override | 200 | @override |
| 195 | - Future<void> setTorchState(TorchState value) { | 201 | + Future<void> setTorchState(TorchState value) async { |
| 196 | switch (value) { | 202 | switch (value) { |
| 197 | case TorchState.unavailable: | 203 | case TorchState.unavailable: |
| 198 | return Future<void>.value(); | 204 | return Future<void>.value(); |
| @@ -204,7 +210,13 @@ final class ZXingBarcodeReader extends BarcodeReader { | @@ -204,7 +210,13 @@ final class ZXingBarcodeReader extends BarcodeReader { | ||
| 204 | return Future<void>.value(); | 210 | return Future<void>.value(); |
| 205 | } | 211 | } |
| 206 | 212 | ||
| 207 | - return _mediaTrackConstraintsDelegate.setFlashlightState(mediaStream, value); | 213 | + await _mediaTrackConstraintsDelegate.setFlashlightState(mediaStream, value); |
| 214 | + | ||
| 215 | + final web.MediaTrackConstraints? constraints = _mediaTrackConstraintsDelegate.getConstraints(mediaStream); | ||
| 216 | + | ||
| 217 | + if (constraints != null) { | ||
| 218 | + _onMediaTrackConstraintsChanged?.call(constraints); | ||
| 219 | + } | ||
| 208 | } | 220 | } |
| 209 | } | 221 | } |
| 210 | 222 |
-
Please register or login to post a comment