Exemple #1
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            _backend = new BarcodeReaderInterop(JSRuntime);
            await GetVideoInputDevicesAsync();

            BarcodeReaderInterop.BarcodeReceived += ReceivedBarcodeText;
            if (StartCameraAutomatically && _videoInputDevices.Count > 0)
            {
                _backend.SetVideoInputDevice(_videoInputDevices[0].DeviceId);
                StartDecoding();
            }
        }
Exemple #2
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            _backend = new BarcodeReaderInterop(JSRuntime);
            _backend.SetLastDecodedPictureFormat(DecodedPictureCapture ? "image/jpeg" : null);

            await GetVideoInputDevicesAsync();

            BarcodeReaderInterop.BarcodeReceived += ReceivedBarcodeText;
            if (StartCameraAutomatically && _videoInputDevices.Count > 0)
            {
                _backend.SetVideoInputDevice(SelectedVideoInputId);
                StartDecoding();
            }
        }
Exemple #3
0
 protected void ChangeVideoInputSource(string deviceId)
 {
     _backend.SetVideoInputDevice(deviceId);
     RestartDecoding();
     SelectedVideoInputId = deviceId;
 }