Skip to content

Conversation

navaronbracke
Copy link
Collaborator

@navaronbracke navaronbracke commented Sep 9, 2024

Fixes #1172
Fixes #1174

enum EncryptionType {
/// Unknown encryption type.
none(0),
unknown(0),
Copy link
Collaborator Author

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 3:
return EncryptionType.wep;
default:
throw ArgumentError.value(value, 'value', 'Invalid raw value.');
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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

@navaronbracke navaronbracke changed the title Handle unknown barcode data enum types fix: Handle unknown barcode data enum types Sep 9, 2024
@navaronbracke navaronbracke changed the title fix: Handle unknown barcode data enum types fix: Handle unknown barcode data enum types & disable media controls Sep 9, 2024

// 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;
Copy link
Collaborator Author

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.

@navaronbracke navaronbracke merged commit 23f3dd3 into juliansteenbakker:master Sep 9, 2024
6 checks passed
@navaronbracke navaronbracke deleted the unknown_encryption_type branch September 9, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mobile_scanner overlay on iOS webview Exception when scanning WIFI QR code with encryption type set to SAE (iOS only)
1 participant