Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
javascript access webcam stream and take photo
| Date | Stars |
|---|---|
| 2026-07-24 | 261 |
| 2026-07-25 | 261 |
| 2026-07-28 | 261 |
| 2026-07-30 | 261 |
| 2026-08-06 | 261 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Webcam Easy JS
This is a javascript library for accessing webcam stream and taking photos.
You can easily add it as a module to your own app.
- Streaming webcam on desktop computer or mobile
- Switch back or front cameras on mobile
- Take pictures and be able to download.
## Live Demo
**[https://bensonruan.com/how-to-access-webcam-and-take-photo-with-javascript/](https://bensonruan.com/how-to-access-webcam-and-take-photo-with-javascript/)**

## Installation
#### Use Git Clone
``` shell
git https://github.com/bensonruan/webcam-easy.git
```
#### OR Use NPM
[](https://nodei.co/npm/webcam-easy/)
``` shell
npm install webcam-easy
```
## Usage
#### 1. Include script tag in html <head>
```html
<script type="text/javascript" src="https://unpkg.com/webcam-easy/dist/webcam-easy.min.js"></script>
```
or Import into javascript
``` js
import Webcam from 'webcam-easy';
```
#### 2. Place elements in HTML
```html
<video id="webcam" autoplay playsinline width="640" height="480"></video>
<canvas id="canvas" class="d-none"></canvas>
<audio id="snapSound" src="audio/snap.wav" preload = "auto"></audio>
```
#### 3. Call constructor in javascript
``` js
const webcamElement = document.getElementById('webcam');
const canvasElement = document.getElementById('canvas');
const snapSoundElement = document.getElementById('snapSound');
const webcam = new Webcam(webcamElement, 'user', canvasElement, snapSoundElement);
```
#### 4. Start Webcam
``` js
webcam.start()
.then(result =>{
console.log("webcam started");
})
.catch(err => {
console.log(err);
});
```
#### 5. Take Photo
``` js
var picture = webcam.snap();
```
#### 6. Stop Webcam
``` js
webcam.stop();
```
## Functions
- start(startStream) : start streaming webcam
- get permission from user
- get all video input devices info
- select camera based on facingMode
- start stream
startStream is optional parameter, default value is true
- stop() : stop streaming webcam
- stream() : start streaming webcam to video element
- snap() : take photo from webcam
- flip() : change Facing mode and selected camera
## Properties
- facingMode : 'user' or 'enviroment'
- webcamList : all available camera device
- webcamCount : number of available camera device
## Support me
[](https://ko-fi.com/W7W6METMY)
Excerpt of 2,531 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:edad678244de5c94, topic:computer-vision