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

@capacitor-community/camera-preview

Package Overview
Dependencies
Maintainers
42
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/camera-preview - npm Package Compare versions

Comparing version 5.0.0-0 to 5.0.0

android/.gradle/8.0.2/fileHashes/resourceHashesCache.bin

2

dist/esm/definitions.d.ts

@@ -59,3 +59,5 @@ export type CameraPosition = 'rear' | 'front';

start(options: CameraPreviewOptions): Promise<{}>;
startRecordVideo(options: CameraPreviewOptions): Promise<{}>;
stop(): Promise<{}>;
stopRecordVideo(): Promise<{}>;
capture(options: CameraPreviewPictureOptions): Promise<{

@@ -62,0 +64,0 @@ value: string;

2

dist/esm/index.d.ts

@@ -1,4 +0,4 @@

import { CameraPreviewPlugin } from './definitions';
import type { CameraPreviewPlugin } from './definitions';
declare const CameraPreview: CameraPreviewPlugin;
export * from './definitions';
export { CameraPreview };
import { WebPlugin } from '@capacitor/core';
import { CameraPreviewOptions, CameraPreviewPictureOptions, CameraPreviewPlugin, CameraPreviewFlashMode, CameraSampleOptions, CameraOpacityOptions } from './definitions';
import type { CameraPreviewOptions, CameraPreviewPictureOptions, CameraPreviewPlugin, CameraPreviewFlashMode, CameraSampleOptions, CameraOpacityOptions } from './definitions';
export declare class CameraPreviewWeb extends WebPlugin implements CameraPreviewPlugin {

@@ -11,2 +11,4 @@ /**

start(options: CameraPreviewOptions): Promise<{}>;
startRecordVideo(): Promise<{}>;
stopRecordVideo(): Promise<{}>;
stop(): Promise<any>;

@@ -24,3 +26,1 @@ capture(options: CameraPreviewPictureOptions): Promise<any>;

}
declare const CameraPreview: CameraPreviewWeb;
export { CameraPreview };

@@ -14,3 +14,3 @@ import { WebPlugin } from '@capacitor/core';

audio: !options.disableAudio,
video: true
video: true,
})

@@ -49,4 +49,4 @@ .then((stream) => {

width: { ideal: options.width },
height: { ideal: options.height }
}
height: { ideal: options.height },
},
};

@@ -75,2 +75,8 @@ if (options.position === 'rear') {

}
async startRecordVideo() {
throw this.unimplemented('Not implemented on web.');
}
async stopRecordVideo() {
throw this.unimplemented('Not implemented on web.');
}
async stop() {

@@ -82,4 +88,4 @@ const video = document.getElementById('video');

const tracks = st.getTracks();
for (var i = 0; i < tracks.length; i++) {
var track = tracks[i];
for (let i = 0; i < tracks.length; i++) {
const track = tracks[i];
track.stop();

@@ -106,3 +112,5 @@ }

if (options.quality != undefined) {
base64EncodedImage = canvas.toDataURL('image/jpeg', options.quality / 100.0).replace('data:image/jpeg;base64,', '');
base64EncodedImage = canvas
.toDataURL('image/jpeg', options.quality / 100.0)
.replace('data:image/jpeg;base64,', '');
}

@@ -136,6 +144,2 @@ else {

}
const CameraPreview = new CameraPreviewWeb();
export { CameraPreview };
import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(CameraPreview);
//# sourceMappingURL=web.js.map
{
"name": "@capacitor-community/camera-preview",
"version": "5.0.0-0",
"version": "5.0.0",
"description": "Camera preview",
"main": "dist/esm/index.js",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"unpkg": "dist/plugin.js",
"scripts": {
"build": "npm run clean && tsc",
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
"verify:android": "cd android && ./gradlew clean build test && cd ..",
"verify:web": "npm run build",
"build": "npm run clean && tsc && rollup -c rollup.config.js",
"clean": "rimraf './dist'",

@@ -17,11 +23,10 @@ "watch": "tsc --watch",

"prepublishOnly": "npm run build",
"prepare": "husky install && npm run build"
"prepare": "husky install && npm run build",
"release": "np --any-branch --yolo"
},
"author": "Ariel Hernandez Musa",
"license": "MIT",
"dependencies": {
"@capacitor/core": "^5.0.0"
},
"devDependencies": {
"@capacitor/android": "^5.0.0",
"@capacitor/core": "^5.0.0",
"@capacitor/ios": "^5.0.0",

@@ -34,2 +39,3 @@ "@ionic/eslint-config": "^0.3.0",

"husky": "^7.0.4",
"np": "^7.7.0",
"prettier": "^2.5.1",

@@ -39,5 +45,9 @@ "prettier-plugin-java": "^1.6.1",

"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"swiftlint": "^1.0.1",
"typescript": "^4.3.2"
},
"peerDependencies": {
"@capacitor/core": "^5.0.0"
},
"husky": {

@@ -44,0 +54,0 @@ "hooks": {

@@ -5,3 +5,3 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

<br>
<p align="center"><strong>CAPACITOR 4</strong></p><br>
<p align="center"><strong>CAPACITOR 5</strong></p><br>

@@ -12,5 +12,10 @@ <p align="center">

<br>
Version 4 of this plugin requires Capacitor 4. If you are using Capacitor 3, use [version 3](https://github.com/capacitor-community/camera-preview/releases/tag/v3.1.2)
Version 2+ of this plugin is compatible with Ionic 5+ and Capacitor 3. If your project uses Capacitor 2, please make sure you install [version 1](https://github.com/capacitor-community/camera-preview/releases/tag/v1.2.1) of this plugin.
Version 5 of this plugin requires Capacitor 5.
If you are using Capacitor 4, use [version 4](https://github.com/capacitor-community/camera-preview/releases/tag/v4.0.0)
If you are using Capacitor 3, use [version 3](https://github.com/capacitor-community/camera-preview/releases/tag/v3.1.2)
If you are using Capacitor 2, use [version 1](https://github.com/capacitor-community/camera-preview/releases/tag/v1.2.1)
**PR's are greatly appreciated.**

@@ -58,2 +63,8 @@

### Variables
This plugin will use the following project variables (defined in your app's `variables.gradle` file):
- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.6`)
## Extra iOS installation steps

@@ -63,14 +74,10 @@ You will need to add two permissions to `Info.plist`. Follow the [Capacitor docs](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) and add permissions with the raw keys `NSCameraUsageDescription` and `NSMicrophoneUsageDescription`. `NSMicrophoneUsageDescription` is only required, if audio will be used. Otherwise set the `disableAudio` option to `true`, which also disables the microphone permission request.

## Extra Web installation steps
Add `import '@capacitor-community/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin
then in html add
Add `import { CameraPreview } from '@capacitor-community/camera-preview';` in the file where you want to use the plugin.
<div id="cameraPreview"></div>
then in html add `<div id="cameraPreview"></div>`
and
ngOnInit() { const { CameraPreview } = Plugins; CameraPreview.start({ parent: "cameraPreview"}); }
and `CameraPreview.start({ parent: "cameraPreview"});` will work.
it will work
# Methods

@@ -264,3 +271,3 @@

### startRecordVideo(options) ---- ANDROID only
### startRecordVideo(options) ---- ANDROID and iOS only

@@ -279,3 +286,3 @@ <info>Start capturing video</info><br/>

### stopRecordVideo() ---- ANDROID only
### stopRecordVideo() ---- ANDROID and iOS only

@@ -286,3 +293,2 @@ <info>Finish capturing a video. The captured video will be returned as a file path and the video format is .mp4</info><br/>

const resultRecordVideo = await CameraPreview.stopRecordVideo();
this.stopCamera();
```

@@ -289,0 +295,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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