1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// The CSS selector used to query the camera video element from the DOM.
pub const CAMERA_VIDEO_SELECTOR: &str = "#camera-video";
/// The facing mode constraint value for the user-facing (front) camera.
pub const CAMERA_FACING_MODE_USER: &str = "user";
/// The facing mode constraint value for the environment-facing (rear) camera.
pub const CAMERA_FACING_MODE_ENVIRONMENT: &str = "environment";
/// The interval in milliseconds between QR code scan attempts.
pub const CAMERA_SCAN_INTERVAL_MILLIS: i32 = 500;
/// The prefix used to detect URL strings in QR code scan results.
pub const CAMERA_URL_PREFIX_HTTP: &str = "http://";
/// The prefix used to detect secure URL strings in QR code scan results.
pub const CAMERA_URL_PREFIX_HTTPS: &str = "https://";
/// The hostname that represents the local loopback device.
pub const CAMERA_LOCALHOST_HOSTNAME: &str = "localhost";
/// The JS method name on a `BarcodeDetector` instance, cached across scans.
pub const CAMERA_DETECT_FN_KEY: &str = "detect";
/// The error returned when the page has no `window` to open a camera from.
pub const CAMERA_NO_WINDOW_ERROR: &str = "no global window exists";
/// The JS constraint key selecting which physical camera to open.
pub const CAMERA_FACING_MODE_KEY: &str = "facingMode";
/// The console prefix tagging every camera diagnostic message.
pub const CAMERA_LOG_PREFIX: &str = "[euv-camera]";
/// The no-op detector body used when the platform exposes no `detect` method.
pub const CAMERA_DETECT_FALLBACK_BODY: &str = "return Promise.resolve([])";
/// The JS global exposing the `BarcodeDetector` constructor.
pub const CAMERA_BARCODE_DETECTOR_KEY: &str = "BarcodeDetector";
/// The message set when the browser has no `BarcodeDetector` support.
pub const CAMERA_BARCODE_UNSUPPORTED_MESSAGE: &str =
"BarcodeDetector API is not supported in this browser";
/// The only barcode format this scanner requests from `BarcodeDetector`.
pub const CAMERA_BARCODE_FORMAT_QR_CODE: &str = "qr_code";
/// The JS option key carrying the requested barcode formats.
pub const CAMERA_BARCODE_FORMATS_KEY: &str = "formats";
/// The JS result key holding a detected barcode's decoded text.
pub const CAMERA_BARCODE_RAW_VALUE_KEY: &str = "rawValue";
/// The JS method name opening a URL in a new browsing context.
pub const CAMERA_WINDOW_OPEN_KEY: &str = "open";