Search code examples
asp.net-corerazorqr-codewebcam

Access web camera - .NET Core Web Application


Is there a possibility to access a web camera from Razor Page level (.NET Core 2.1 Web Application)?

I am aiming to achieve online QR code scanner. I am almost sure that I can process captured image with ZXing.Net. What I am missing is the video captured from camera (and as the result screenshots with QR codes).


Solution

  • You can only access the camera client-side (given user permission to do so), not server-side. But, if you need the still server-side, it's just a matter of making an AJAX call following to send what you capture client-side back to the server.

    For accessing the camera client-side, see: https://developers.google.com/web/fundamentals/media/capturing-images#access_the_camera_interactively