
Security News
npm Tooling Bug Incorrectly Marks One-Character Packages as Security Holders
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.
A simple Angular webcam component. Pure & minimal, no Flash-fallback.基于ngx-webcam二次开发,根据项目需要进行了修改,无法通用于其他项目。如需使用,请使用前往:ngx-webcam
Plug-and-play. This library contains a single module which can be imported into every standard Angular 9+ project.
Simple to use. The one component gives you full control and lets you take snapshots via actions and event bindings.
Minimal. No unnecessary Flash-fallbacks, no bundle-size bloating.
Note: Starting from version 0.3.0 this project requires TypeScript >= 3.7.0 (Angular 9). For older versions of Angular/TypeScript, please use version 0.2.6 of this library.
>=9.0.0>=3.7.0>=5.0.0https:// or on localhost, for modern browsers to permit WebRTC/UserMedia access.npm install --save ng-cam
WebcamModule into your Angular module:import {WebcamModule} from 'ng-cam';
@NgModule({
imports: [
WebcamModule,
...
],
...
})
export class AppModule { }
WebcamComponent on your pages:<webcam></webcam>
As simple as that.
This section describes the basic inputs/outputs of the component. All inputs are optional.
trigger: Observable<void>: An Observable to trigger image capturing. When it fires, an image will be captured and emitted (see Outputs).width: number: The maximal video width of the webcam live view.height: number: The maximal video height of the webcam live view. The actual view will be placed within these boundaries, respecting the aspect ratio of the video stream.videoOptions: MediaTrackConstraints: Defines constraints (MediaTrackConstraints) to apply when requesting the video track.mirrorImage: string | WebcamMirrorProperties: Flag to control image mirroring. If the attribute is missing or null and the camera claims to be user-facing, the image will be mirrored (x-axis) to provide a better user experience ("selfie view"). A string value of "never" will prevent mirroring, whereas a value of "always" will mirror every camera stream, even if the camera cannot be detected as user-facing. For future extensions, the WebcamMirrorProperties object can also be used to set these values.allowCameraSwitch: boolean: Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras are found.switchCamera: Observable<boolean|string>: Can be used to cycle through available cameras (true=forward, false=backwards), or to switch to a specific device by deviceId (string).captureImageData: boolean = false: Flag to enable/disable capturing of a lossless pixel ImageData object when a snapshot is taken. ImageData will be included in the emitted WebcamImage object.imageType: string = 'image/jpeg': Image type to use when capturing snapshots. Default is 'image/jpeg'.imageQuality: number = 0.92: Image quality to use when capturing snapshots. Must be a number between 0..1. Default is 0.92.imageRotate: number = 0: 当使用拍照时,图片旋转角度建议值 0 、-90、90、180imageCapture: EventEmitter<WebcamImage>: Whenever an image is captured (i.e. triggered by [trigger]), the image is emitted via this EventEmitter. The image data is contained in the WebcamImage data structure as both, plain Base64 string and data-url.imageClick: EventEmitter<void>: An EventEmitter to signal clicks on the webcam area.initError: EventEmitter<WebcamInitError>: An EventEmitter to signal errors during the webcam initialization.cameraSwitched: EventEmitter<string>: Emits the active deviceId after the active video device has been switched.When camera initialization fails for some reason, the component emits a WebcamInitError via the initError EventEmitter. If provided by the browser, this object contains a field mediaStreamError: MediaStreamError which contains information about why UserMedia initialization failed. According to Mozilla API docs, this object contains a name attribute which gives insight about the reason.
If the user denies permission, or matching media is not available, then the promise is rejected with NotAllowedError or NotFoundError respectively.
Determine if a user has denied permissions:
<webcam (initError)="handleInitError($event)"></webcam>
public handleInitError(error: WebcamInitError): void {
if (error.mediaStreamError && error.mediaStreamError.name === "NotAllowedError") {
console.warn("Camera access was not allowed by user!");
}
}
Here you can find instructions on how to start developing this library.
Run npm run packagr to build the library. The build artifacts will be stored in the dist/ directory.
Run npm start to build and run the surrounding demo app with the WebcamModule. Essential for live-developing.
Run npm run docs to generate the live-demo documentation pages in the docs/ directory.
Run npm run test to run unit-tests.
npm run packagr
cd dist
npm pack
npm login --registry=http://registry.npmjs.org/
npm publish --registry=http://registry.npmjs.org/
FAQs
Unknown package
The npm package ng-cam receives a total of 7 weekly downloads. As such, ng-cam popularity was classified as not popular.
We found that ng-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
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.