public static void ReceiveBarcode(string barcodeText) { /* Unfortunately JS is unable to invoke public methods of internal classes. Thus * we route the call to the internal class at this point. This allows us to hide away * the rest of the interop from the component's client. */ BarcodeReaderInterop.OnBarcodeReceived(barcodeText); }
public void StopDecoding() { BarcodeReaderInterop.OnBarcodeReceived(string.Empty); _backend.StopDecoding(); IsDecoding = false; StateHasChanged(); }
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(); } }
public static void ReceiveNotFound() { BarcodeReaderInterop.OnNotFoundReceived(); }