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