New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mage-react-cam

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mage-react-cam - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

27

dist/MageReactCam.d.ts

@@ -0,5 +1,29 @@

type CustomMediaTrackCapabilitiesProps = MediaTrackCapabilities & {
torch: any;
};
interface CustomVideoTrackProps {
getCapabilities: () => CustomMediaTrackCapabilitiesProps;
getConstraints: () => CustomMediaTrackCapabilitiesProps;
applyConstraints: (data: {
advanced: {
torch: any;
}[];
}) => Promise<void>;
}
type GetTrackProps = {
stop: () => void;
};
export interface MediaSrcObjectProps {
getVideoTracks: () => CustomVideoTrackProps[];
getTracks: () => GetTrackProps[];
removeTrack: (data: GetTrackProps) => void;
}
export type CustomMediaVideoProps = HTMLVideoElement & {
srcObject: MediaSrcObjectProps;
};
export type TReactCamRef = {
snapshot: () => void;
snapshot: () => string | undefined;
zoomIn: () => void;
zoomOut: () => void;
video?: CustomMediaVideoProps;
};

@@ -11,4 +35,5 @@ interface MageReactCamProps {

height?: number;
facingMode?: "environment" | "user";
}
declare const MageReactCam: import("react").ForwardRefExoticComponent<MageReactCamProps & import("react").RefAttributes<TReactCamRef>>;
export default MageReactCam;

14

dist/MageReactCam.js
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef, useEffect, useImperativeHandle, useRef, useState, } from 'react';
const MageReactCam = forwardRef(({ onUserMediaError, videoConstraints, width, height }, ref) => {
import { forwardRef, useEffect, useImperativeHandle, useRef, useState, } from "react";
const MageReactCam = forwardRef(({ onUserMediaError, videoConstraints, width, height, facingMode, }, ref) => {
const internalRef = useRef(null);

@@ -8,8 +8,8 @@ const snapshot = () => {

const video = internalRef.current;
const tempCanvas = document.createElement('canvas');
const tempContext = tempCanvas.getContext('2d');
const tempCanvas = document.createElement("canvas");
const tempContext = tempCanvas.getContext("2d");
tempCanvas.width = video.videoWidth;
tempCanvas.height = video.videoHeight;
tempContext?.drawImage(video, 0, 0, tempCanvas.width, tempCanvas.height);
const dataURL = tempCanvas.toDataURL('image/jpeg');
const dataURL = tempCanvas.toDataURL("image/jpeg");
return dataURL;

@@ -37,3 +37,3 @@ }

video: {
facingMode: 'environment',
facingMode: facingMode || "environment",
width: { ideal: width || 500 },

@@ -78,3 +78,3 @@ height: { ideal: height || 500 },

});
MageReactCam.displayName = 'MageReactCam';
MageReactCam.displayName = "MageReactCam";
export default MageReactCam;
{
"name": "mage-react-cam",
"version": "1.0.5",
"version": "1.0.6",
"description": "A React component for capturing camera input",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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