Accessing Smartphone And Laptop Cameras In The Web With Javascript

Andy Kong
5 min readJan 16, 2021

Hello! Today I’m going to show you how to access the built-in cameras in-browser, on computers and mobile devices using Javascript.

In this series, I will show you how to set up a simple HTML page that accesses the front-facing camera, runs MediaPipe Facemesh to detect facial keypoints, and then shows a livestream using the detection features.

This post in particular will show you how to:

  • Properly access a device’s camera through the Javascript MediaDevices interface…

--

--