
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@nickkaramoff/vue-web-cam
Advanced tools
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.
npm install vue-web-cam --save
// or
yarn add vue-web-cam
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 ... />
Add vue-web-cam/nuxt
to modules section of nuxt.config.js
{
modules: ['vue-web-cam/nuxt']
}
npm run dev
prop | type | default | notes |
---|---|---|---|
height | number | 500 | height of video element |
width | number | 500 | width of video element |
autoplay | boolean | true | autoplay attribute |
screenshotFormat | string | 'image/jpeg' | format of screenshot |
selectFirstDevice | boolean | false | select first device when avaialble |
deviceId | string | null | currently selected camera |
playsinline | boolean | true | playsinline of video element |
resolution | object | null | object with width and height for camera resolution |
name | param | notes |
---|---|---|
started | stream | emitted once the stream has started |
stopped | stream | emitted once the stream has stopped |
error | error | emitted if the stream failed to start with the error returned |
notsupported | error | emitted when the browser does not support this feature |
cameras | cameras | emitted when a list of all cameras available is loaded |
camera-change | deviceId | emitted when camera change occurs |
video-live | stream | emitted when video is started |
name | param | notes |
---|---|---|
capture | void | Capture the current image through the webcam as a base64 encoded dataUri |
changeCamera | deviceId | change the currently selected camera. Must pass in the device ID |
start | void | Programmatically Start the camera after stopping it (relies on deviceId prop passed to the component) |
stop | void | Programmatically stop the camera |
pause | void | Programmatically pause the camera |
resume | void | Programmatically resume the camera after it was paused |
If you'd like to help make this project better you can help with the following tasks:
MIT
This is based off @smronju vue-webcam and react-webcam
FAQs
Webcam component for Vuejs applications
We found that @nickkaramoff/vue-web-cam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.