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

@yoonit/nativescript-camera

Package Overview
Dependencies
Maintainers
9
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yoonit/nativescript-camera - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

plugin.js

2

package.json
{
"name": "@yoonit/nativescript-camera",
"version": "1.0.0",
"version": "1.1.0",
"description": "Yoonit Camera have a custom view that shows a preview layer of the front/back camera and detects human faces in it and read qr code.",

@@ -5,0 +5,0 @@ "main": "Yoonit.Camera",

@@ -29,2 +29,14 @@ <img src="https://raw.githubusercontent.com/Yoonit-Labs/nativescript-yoonit-camera/development/logo_cyberlabs.png" width="300">

#### VueJS Plugin
`main.js`
```javascript
import Vue from 'nativescript-vue'
import YoonitCamera from '@yoonit/nativescript-camera/plugin'
Vue.use(YoonitCamera)
```
After that, you can access the camera object in your entire project using `this.$yoo.camera`
#### Vue Component

@@ -36,3 +48,3 @@ `App.vue`

<YoonitCamera
id="yooCamera"
ref="yooCamera"
@faceDetected="doFaceDetected"

@@ -50,20 +62,13 @@ @faceImage="doFaceImage"

export default {
data: () => ({
$yoo: null
}),
data: () => ({}),
methods: {
async onLoaded(args) {
this.$yoo = {
camera: null
}
console.log('[YooCamera] Getting Camera view')
this.$yoo.camera = args.object.getViewById('yooCamera')
this.$yoo.camera.registerElement(this.$refs.yooCamera)
console.log('[YooCamera] Getting permission')
const permissionGranted = await this.$yoo.camera.requestPermission()
if (await this.$yoo.camera.requestPermission()) {
console.log('[YooCamera] Permission granted, start preview')
if (permissionGranted) {
console.log('[YooCamera] Permission granted, start preview')
this.$yoo.camera.preview()

@@ -139,2 +144,3 @@ }

|-|-|-|-|-|
| **`requestPermission`** | - | promise | - | Ask to user to give the permission to access camera.
| **`hasPermission`** | - | boolean | - | Return if application has camera permission.

@@ -141,0 +147,0 @@ | **`preview`** | - | void | - | Start camera preview if has permission.

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