HTML5 introduces WebRTC APIs that let you to access the camera on the computer or mobile phone and take photos from it.
Implementation of this is very easy. I am showing you the easiest process to access webcam from web browser. It will work in almost every web browser. So lets start.
Now open your browser and run this program, you will see a popup will open and ask you for allow webcam access. allow it and your webcam will start and you will see the view of the camera on that page.