
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
capacitor-plugin-dynamsoft-camera-preview
Advanced tools
A Capacitor plugin for camera preview using Dynamsoft Camera Enhancer.
Note: This package is not actively maintained. Please use capacitor-plugin-camera.
For Capacitor v5, use v2.x.
For Capacitor v4, use v1.x.
npm install capacitor-plugin-dynamsoft-camera-preview
npx cap sync
If you are developing a plugin, you can use reflection to get the camera frames as Bitmap or UIImage on the native side.
Java:
Class cls = Class.forName("com.dynamsoft.capacitor.dce.CameraPreviewPlugin");
Method m = cls.getMethod("getBitmap",null);
Bitmap bitmap = (Bitmap) m.invoke(null, null);
Objective-C:
- (UIImage*)getUIImage{
UIImage *image = ((UIImage* (*)(id, SEL))objc_msgSend)(objc_getClass("CameraPreviewPlugin"), sel_registerName("getBitmap"));
return image;
}
initialize()getResolution()setResolution(...)getAllCameras()getSelectedCamera()selectCamera(...)setScanRegion(...)setZoom(...)setFocus(...)setDefaultUIElementURL(...)startCamera()stopCamera()pauseCamera()resumeCamera()takeSnapshot(...)takeSnapshot2()takePhoto()toggleTorch(...)requestCameraPermission()isOpen()addListener('onPlayed', ...)removeAllListeners()initialize() => Promise<void>
getResolution() => Promise<{ resolution: string; }>
Returns: Promise<{ resolution: string; }>
setResolution(options: { resolution: number; }) => Promise<void>
| Param | Type |
|---|---|
options | { resolution: number; } |
getAllCameras() => Promise<{ cameras: string[]; }>
Returns: Promise<{ cameras: string[]; }>
getSelectedCamera() => Promise<{ selectedCamera: string; }>
Returns: Promise<{ selectedCamera: string; }>
selectCamera(options: { cameraID: string; }) => Promise<void>
| Param | Type |
|---|---|
options | { cameraID: string; } |
setScanRegion(options: { region: ScanRegion; }) => Promise<void>
| Param | Type |
|---|---|
options | { region: ScanRegion; } |
setZoom(options: { factor: number; }) => Promise<void>
| Param | Type |
|---|---|
options | { factor: number; } |
setFocus(options: { x: number; y: number; }) => Promise<void>
| Param | Type |
|---|---|
options | { x: number; y: number; } |
setDefaultUIElementURL(url: string) => Promise<void>
Web Only
| Param | Type |
|---|---|
url | string |
startCamera() => Promise<void>
stopCamera() => Promise<void>
pauseCamera() => Promise<void>
resumeCamera() => Promise<void>
takeSnapshot(options: { quality?: number; }) => Promise<{ base64: string; }>
take a snapshot as base64.
| Param | Type |
|---|---|
options | { quality?: number; } |
Returns: Promise<{ base64: string; }>
takeSnapshot2() => Promise<{ frame: DCEFrame; }>
take a snapshot as DCEFrame. Web Only
Returns: Promise<{ frame: DCEFrame; }>
takePhoto() => Promise<{ base64: string; }>
Returns: Promise<{ base64: string; }>
toggleTorch(options: { on: boolean; }) => Promise<void>
| Param | Type |
|---|---|
options | { on: boolean; } |
requestCameraPermission() => Promise<void>
isOpen() => Promise<{ isOpen: boolean; }>
Returns: Promise<{ isOpen: boolean; }>
addListener(eventName: 'onPlayed', listenerFunc: onPlayedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
|---|---|
eventName | 'onPlayed' |
listenerFunc | onPlayedListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners() => Promise<void>
measuredByPercentage: 0 in pixel, 1 in percent
| Prop | Type |
|---|---|
left | number |
top | number |
right | number |
bottom | number |
measuredByPercentage | number |
| Prop | Type |
|---|---|
data | Uint8Array |
region | Region |
sx | number |
sy | number |
width | number |
height | number |
stride | number |
colorMode | string |
pixelFormat | string |
timeSpent | number |
timeStamp | number |
isCropped | boolean |
toCanvas | () => any |
_sWidth | number |
_sHeight | number |
_bUseWebGL | boolean |
A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised.
| Prop | Type | Description |
|---|---|---|
BYTES_PER_ELEMENT | number | The size in bytes of each element in the array. |
buffer | ArrayBufferLike | The ArrayBuffer instance referenced by the array. |
byteLength | number | The length in bytes of the array. |
byteOffset | number | The offset in bytes of the array. |
length | number | The length of the array. |
| Method | Signature | Description |
|---|---|---|
| copyWithin | (target: number, start: number, end?: number | undefined) => this | Returns the this object after copying a section of the array identified by start and end to the same array starting at position target |
| every | (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean | Determines whether all the members of an array satisfy the specified test. |
| fill | (value: number, start?: number | undefined, end?: number | undefined) => this | Returns the this object after filling the section identified by start and end with value |
| filter | (predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any) => Uint8Array | Returns the elements of an array that meet the condition specified in a callback function. |
| find | (predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any) => number | undefined | Returns the value of the first element in the array where predicate is true, and undefined otherwise. |
| findIndex | (predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any) => number | Returns the index of the first element in the array where predicate is true, and -1 otherwise. |
| forEach | (callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any) => void | Performs the specified action for each element in an array. |
| indexOf | (searchElement: number, fromIndex?: number | undefined) => number | Returns the index of the first occurrence of a value in an array. |
| join | (separator?: string | undefined) => string | Adds all the elements of an array separated by the specified separator string. |
| lastIndexOf | (searchElement: number, fromIndex?: number | undefined) => number | Returns the index of the last occurrence of a value in an array. |
| map | (callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any) => Uint8Array | Calls a defined callback function on each element of an array, and returns an array that contains the results. |
| reduce | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number) => number | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reduce | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number) => number | |
| reduce | <U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U) => U | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reduceRight | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number) => number | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reduceRight | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number) => number | |
| reduceRight | <U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U) => U | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reverse | () => Uint8Array | Reverses the elements in an Array. |
| set | (array: ArrayLike<number>, offset?: number | undefined) => void | Sets a value or an array of values. |
| slice | (start?: number | undefined, end?: number | undefined) => Uint8Array | Returns a section of an array. |
| some | (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean | Determines whether the specified callback function returns true for any element of an array. |
| sort | (compareFn?: ((a: number, b: number) => number) | undefined) => this | Sorts an array. |
| subarray | (begin?: number | undefined, end?: number | undefined) => Uint8Array | Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. |
| toLocaleString | () => string | Converts a number to a string by using the current locale. |
| toString | () => string | Returns a string representation of an array. |
| valueOf | () => Uint8Array | Returns the primitive value of the specified object. |
| Prop | Type |
|---|---|
length | number |
Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.
| Prop | Type |
|---|---|
ArrayBuffer | ArrayBuffer |
Represents a raw buffer of binary data, which is used to store data for the different typed arrays. ArrayBuffers cannot be read from or written to directly, but can be passed to a typed array or DataView Object to interpret the raw buffer as needed.
| Prop | Type | Description |
|---|---|---|
byteLength | number | Read-only. The length of the ArrayBuffer (in bytes). |
| Method | Signature | Description |
|---|---|---|
| slice | (begin: number, end?: number | undefined) => ArrayBuffer | Returns a section of an ArrayBuffer. |
| Prop | Type |
|---|---|
regionBottom | number |
regionRight | number |
regionLeft | number |
regionTop | number |
regionMeasuredByPercentage | number | boolean |
| Prop | Type |
|---|---|
remove | () => Promise<void> |
ArrayBufferTypes[keyof ArrayBufferTypes]
(result: { resolution: string; }): void
FAQs
A Capacitor plugin for camera preview
The npm package capacitor-plugin-dynamsoft-camera-preview receives a total of 6 weekly downloads. As such, capacitor-plugin-dynamsoft-camera-preview popularity was classified as not popular.
We found that capacitor-plugin-dynamsoft-camera-preview 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.