-
-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Handle unknown barcode data enum types & disable media controls #1175
fix: Handle unknown barcode data enum types & disable media controls #1175
Conversation
@@ -1,7 +1,7 @@ | |||
/// Wifi encryption type constants. | |||
enum EncryptionType { | |||
/// Unknown encryption type. | |||
none(0), | |||
unknown(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted in #1172
Android: never reported 'none/unknown'
iOS: reported MLKBarcodeWiFiEncryptionTypeUnknown
as integer 0
So this constant's name is wrong, but the documentation is correct. I opted into deprecating the old name (providing a static const for users to migrate), to match the new, correct behavior.
case 1: | ||
return EncryptionType.open; | ||
case 2: | ||
return EncryptionType.wpa; | ||
case 3: | ||
return EncryptionType.wep; | ||
default: | ||
throw ArgumentError.value(value, 'value', 'Invalid raw value.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the strange integer 4 that was reported in #1172
@Deprecated( | ||
'EncryptionType.none is deprecated. Use EncryptionType.unknown instead.', | ||
) | ||
static const EncryptionType none = EncryptionType.unknown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibility, Included a static const alias that points to the old name.
We can remove this constant in version 6.0.0
@@ -88,6 +88,18 @@ class MobileScannerWeb extends MobileScannerPlatform { | |||
..transformOrigin = 'center' | |||
..pointerEvents = 'none'; | |||
|
|||
// Do not show the media controls, as this is a preview element. | |||
// Also prevent play/pause events from changing the media controls. | |||
videoElement.controls = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently we did not unset the controls for the video element. iOS WKWebviews might add the controls to the video, unless prevented.
Fixes #1172
Fixes #1174