Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 3
0
 protected void ChangeVideoInputSource(string deviceId)
 {
     _backend.SetVideoInputDevice(deviceId);
     RestartDecoding();
     SelectedVideoInputId = deviceId;
 }