
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
camera-util
Advanced tools
npm install camera-util
useCamera.createCamera({
context: video dom,
constraints: {
audio: false,// 是否开启音频
video: {
height: { ideal: 1080 },// 录制高度
width: { ideal: 1920 },// 录制宽度
frameRate: { ideal: 30 }// 帧率
}
},
uploadConfig: {
uploadModel: 'local',//本地存储还是云端上传
uploadType: 'image',//录制模式还是图片模式
},
config: {//可选项,不设置则按默认值设置
type: 'image/jpeg',//文件格式
quality: 1,//图片的压缩因子
width: 1080,//图片宽度
height: 1920,//图片高度
}
})
参数 | 说明 | 类型 | 是否必填 |
---|---|---|---|
context | video的dom元素 | HTMLVideoElement | 必填 |
constraints | 摄像头参数 | IMediaStreamConstraints | 必填 |
uploadConfig | 上传参数 | IUploadConfig | 必填 |
config | 录制参数,type参数根据uploadType选择正确的文件格式 | ICameraMideaConfig | 选填 |
const cb = await useCamera.startCatch()
返回值 | 说明 |
---|---|
Promise | 结束录制时传入这个function |
useCamera.upload(ossClient,
{
backQuestion: Boolean,
currentIdex: Number,
formId,
userId,
preDir
})
参数 | 说明 | 类型 | 是否必填 |
---|---|---|---|
ossClient | 上传到云端的oss实例 | OSS | 必填 |
config | 上传参数(preDir是上传路径前缀) | IUploadConfig | 必填 |
useCamera.stopCatch(stopFn,{
backQuestion: Boolean,
currentIdex: Number,
formId,
userId,
preDir
})
参数 | 说明 | 类型 | 是否必填 |
---|---|---|---|
stopFn | 传入步骤2返回的函数 | Function | 必填 |
config | 上传参数(preDir是上传路径前缀) | IUploadConfig | 必填 |
useCamera.stopCamera()
FAQs
```bash npm install camera-util ```
The npm package camera-util receives a total of 2 weekly downloads. As such, camera-util popularity was classified as not popular.
We found that camera-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.