Git Product home page Git Product logo

vue-cam's Introduction

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'

vue-cam's People

Stargazers

 avatar Lou Rectoret avatar Rory avatar  avatar Vincent DELACOURT avatar

Watchers

James Cloos avatar Alexandre Obellianne avatar

vue-cam's Issues

Camera not workign on IOS

Hi I just added this cam to my project, it works pretty fine in most of the Android phones but it does not for following IPHONES:

  • Iphone 5S
  • Iphone XS

Also I don't know even how to debug on IOS...
Is there any solution?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.