Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nickkaramoff/vue-web-cam

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nickkaramoff/vue-web-cam

Webcam component for Vuejs applications

  • 1.10.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@nickkaramoff/vue-web-cam

npm npm Contributions welcome License

Webcam component for VueJs. See this for browser compatibility.

Heads up!

This package is a fork of vue-web-cam. This one should fix the bug of asking the permission twice. Or not.

This fork probably can be used as a drop-in replacement.

Installation

npm install vue-web-cam --save
// or
yarn add vue-web-cam

Usage

import Vue from 'vue'
import WebCam from "../../src";
Vue.use(WebCam);


<vue-web-cam ... />

// or
import { WebCam } from "vue-web-cam";

components: {
    WebCam
}

<web-cam ... />

components: {
    'vue-web-cam': WebCam
}

<vue-web-cam ... />

Nuxt.js

Add vue-web-cam/nuxt to modules section of nuxt.config.js

{
  modules: ['vue-web-cam/nuxt']
}

Testing & Dev

npm run dev

Props

proptypedefaultnotes
heightnumber500height of video element
widthnumber500width of video element
autoplaybooleantrueautoplay attribute
screenshotFormatstring'image/jpeg'format of screenshot
selectFirstDevicebooleanfalseselect first device when avaialble
deviceIdstringnullcurrently selected camera
playsinlinebooleantrueplaysinline of video element
resolutionobjectnullobject with width and height for camera resolution

Events

nameparamnotes
startedstreamemitted once the stream has started
stoppedstreamemitted once the stream has stopped
errorerroremitted if the stream failed to start with the error returned
notsupportederroremitted when the browser does not support this feature
camerascamerasemitted when a list of all cameras available is loaded
camera-changedeviceIdemitted when camera change occurs
video-livestreamemitted when video is started

Methods

nameparamnotes
capturevoidCapture the current image through the webcam as a base64 encoded dataUri
changeCameradeviceIdchange the currently selected camera. Must pass in the device ID
startvoidProgrammatically Start the camera after stopping it (relies on deviceId prop passed to the component)
stopvoidProgrammatically stop the camera
pausevoidProgrammatically pause the camera
resumevoidProgrammatically resume the camera after it was paused

Contributing

If you'd like to help make this project better you can help with the following tasks:

  • Tests - This project needs a way to test the functionality using a javascript testing solution (Jest as an example)
  • Examples - Additional Examples of usage might be helpful to others.
  • Project Website - Perhaps launch a project website (on Github Pages) that'll showcase the plugin, Demo, Usage instructions, configuration etc..

License

MIT

Credits

This is based off @smronju vue-webcam and react-webcam

FAQs

Package last updated on 19 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc