1.0.2 • Published 2 years ago

simple-web-cam v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Simple-web-cam

Javascript library for easily (and responsively) taking photos on the web.

Installation

Use NPM

npm install simple-web-cam

Usage

1. Import package:

import camera from 'simple-web-cam';

2. Init the camera:

await camera.init();

3. style (optional)

const style = {
border:'2px solid black',
clipPath:'circle(40%)',
}
camera.set_video_style(style)

4. Snap: you got three options

1. snap and download file:  await camera.snap_download(fileName);

2. snap and get file back:  const file = await camera.snap_get_file(type /*png etc'*/);

3. snap and get base64 string:  camera.snap_get_base64();

5. Stop Webcam

camera.stop();