1.1.3 • Published 4 years ago

cameraclick v1.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

��# cameraclick

Capture photos from your webcam easily

Usage

Create a new instance:

  import { CameraClick, createCanvas } from 'cameraclick'
  let camera;
  const element = document.querySelector('#camera')

  camera = new CameraClick(element, {
    onCapture: async (imageData) => {
      const parentDimensions = {
        width: 320, //or the element width, like element.clientWidth
        height: 480 //or the element height, like element.clientHeight
      }
      const resource = await createCanvas(imageData, parentDimensions, 'jpeg', 0.5)
      // resource has two methods: `.toImage()` returns an <img /> 
      // element and `toBase64()` returns an
      // encoded base64 image string 
      camera.close()
    }
  })
1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.0

5 years ago