vue-cam

Intented to be a simple camera component for VueJS.
1,281
Install
npm install vue-cam
Latest Version:0.2.4
Vue:2
License:MIT
Last Updated:Jul 13, 2018
Links: npm
Maintainer: morphet81

Vue Cam

Intented to be a simple camera component for VueJS.

Vue Cam allows you to preview the camera stream at the size you need and to make snapshots of it, conserving the same size and ratio as what you see (WYSIWYG).

Installation

NPM

npm install vue-cam

Yarn

yarn add vue-cam

Usage

Just import vue-cam in your main.js file, the component will be automatically loaded in the global scope.

...
import 'vue-cam'
...

Then put the vc-cam component wherever you need

<vc-cam></vc-cam>

You can make snapshots using the snapshot method of the component. The method will return a base64 string.

First, give a reference to the component

<vc-cam ref="camera"></vc-cam>

Then where you need it

let snapBase64 = this.$refs.camera.snapshot()

Attributes

Attribute Role Default
autoplay Indicates if the preview should start once authorization is given by the user.
Should generally be set to false for mobile devices
true
width The width of the preview area 640
height The height of the preview area 480
fit Indicates how the stream should appear inside the preview area. Uses CSS-like values 'contain' or 'cover' 'cover'

Related Packages

vue-camera-lib

Simple library for Vue.js 3. Display the camera's output or take a photo from th...

138,459 42
multicorder

Record video from cameras or screen. A base Vue 2 component as well as full Vuet...

2,696 15
vue-capture

A Vuejs library to record and save audio, video or pictures from your camera or...

1,871
@harlem/extension-snapshot

The official snapshot extension for Harlem

1,484 515

Version History

Version Released Vue License
0.2.4 ^2.5.16 MIT
0.2.3 ^2.5.16 MIT
0.2.2 ^2.5.16
0.2.1 ^2.5.16
0.2.0 ^2.5.16