
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.
@webcam/core
Advanced tools
Ultimate tool for working with media stream
npm i @webcam/core
# or
yarn add @webcam/core
📸 Webcam Core is a package that includes ready-made solutions for common cases of setting up and using a media stream from your webcam using Web API. Our goal is to create simple and flexible tools that allow users to create, test and maintain their products.
import {
applyMediaStreamConstraints,
getMediaStream,
getMediaStreamConstraints,
stopMediaStream
} from '@webcam/core';
let runningStream: MediaStream | undefined;
const requestStream = async (params: GetMediaStreamConstraintsParams) => {
try {
runningStream = await getMediaStream(params, 5000);
} catch (error) {
console.error(error);
}
};
const updateConstraints = async (params: GetMediaStreamConstraintsParams) => {
try {
const constraints = await getMediaStreamConstraints(params);
applyMediaStreamConstraints(runningStream, constraints)
} catch {
requestMediaStream(params);
}
};
const stopStream = () => stopMediaStream(runningStream);
requestStream({ mainCamera: true }, { width: 1920, height: 1080 });
Adds extra error handling and support for legacy getUserMedia implementation.
NOTE: The function can only be used in a secure context. For example, when a page is loaded using HTTPS or a page loaded from localhost. Otherwise the function will throw an error.
Accepts custom parameters and uses getUserMedia to get an instance of the MediaStream.
params?: {GetMediaStreamConstraintsParams} - Parameters passed to getMediaStreamConstraints functiontimeLimitMs?: {number} - Time limit for MediaStream request executionGenerates and returns media stream constraints by passed options.
constraints?: {MediaStreamConstraints} - External primary constraints (override output)options?: {MediaTrackConstraintsOptions} - Options for constraints generating
muted?: {boolean} - Excludes audio constraints from the MediaStream requestgetVideoTrackConstraints functionGenerates and returns video track constraints by passed options.
frontCamera? {boolean} - Should use a front camera (MediaTrackConstraints['facingFront'] === 'user')mainCamera? {boolean | GetMainCameraParams} - Should find and use the main camera by default/passed label patternscameraResolutionType? {CameraResolutionType} - Video track resolution size (width x height)
HD - 1280 x 720FHD - 1920 x 1080QHD - 2560 x 1440UHD - 3840 x 2160cameraResolutionMode? {keyof ConstrainULongRange} - Video track resolution mode
min - Value is the smallest permissible. If the value cannot remain equal to or greater than this value, matching will fail.max - Value is the largest permissible. If the value cannot remain equal to or less than this value, matching will fail.exact - Value is specific and required. If the value cannot be considered acceptable, the match will fail.ideal - If possible, a value will be used, but if it's not possible, the user agent will use the closest possible match.Returns main camera info in accordance with the default or passed parameters.
NOTE: Requires browser support for Navigator.MediaDevices.enumerateDevices to work.
params? {GetMainCameraParams} - Pattern for searching the main camera device info by its label
back? {RegExp} - Value (?=.*\bback\b)(?=.*\b0\b) is using as defaultfront? {RegExp} - Value \bfront\b is using as defaultisFrontCamera? {boolean} - Should the front camera be searched (back camera as default)Applies a set of audio and video constraints to the corresponding media stream tracks.
NOTE: New constraints apply only within the previously used source.
stream {MediaStream} - Media stream instanceconstraints {MediaStreamConstraints} - Constraints to be appliedStops and removes audio and video tracks from the stream.
stream? {MediaStream | MediaStreamTrack} - Media stream or its track instanceChecks for the presence of getUserMedia in mediaDevices.
Checks the possibility of using any implementation of getUserMedia.
Returns a base64 encoded string of the current video stream frame in the specified format and quality.
source {HTMLVideoElement} - Video element instance with provided media streamoptions? {GetWebcamSnapshotOptions} - Options for getting webcam snapshot
format? - {image/webp | image/png | image/jpeg} - A string indicating the image format (default === image/jpeg)quality? - {number} - A number between 0 and 1 indicating the image quality (only for image/jpeg or image/webp)getVideoFrameCanvas functionReturns a canvas with a drawn image of the current video stream frame in accordance with the passed options.
source {HTMLVideoElement} - Video element instance with provided media streamoptions? {GetVideoFrameCanvasOptions} - Options for getting video frame canvas
width? {number} - Width of the canvas on which the image will be drawnheight? {number} - Height of the canvas on which the image will be drawnmirrored? {boolean} - Should the drawing image be mirrored horizontallyimageSmoothingEnabled? {boolean} - Should smooth scaled image or not (default === true)|
🌶️ michael-mir |
🧊 debabin |
🐘 RiceWithMeat |
FAQs
Ultimate tool for working with media stream
We found that @webcam/core 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.