# zcamera

> 谷歌照相

Latest version **1.0.3** (published 2020-11-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install zcamera
pnpm add zcamera
yarn add zcamera
bun add zcamera
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-11-03 |
| First published | 2020-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 22.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 2020/11/02 |
| Maintainers | zengshaofeng |
| Keywords | 照相机, 图片, 谷歌照相, 摄像头, camera, 相机插件 |

## Links

- npm: https://www.npmjs.com/package/zcamera
- Repository: https://github.com/ZANETACK/ZCamera
- Homepage: https://github.com/ZANETACK/ZCamera#readme
- Issues: https://github.com/ZANETACK/ZCamera/issues
- npm.io page: https://npm.io/package/zcamera

## Recent versions

- 1.0.3 (latest) — 2020-11-03
- 1.0.2 — 2020-11-02
- 1.0.1 — 2020-11-02
- 1.0.0 — 2020-11-02

## README

# ZCamera
浏览器相机

# 使用
```html
 <div id="camera"></div>
<script>
    let camera = new ZCamera({
        el: '#camera'
    });
    
    //启动
    let start = document.getElementById('start');
    start.onclick = function () {
        console.log('正在启动摄像机')
        camera.open().then(data => {
            console.log('status',data)
            if(data.status === "opened"){
                console.log('摄像机启动成功')
            }else{
                console.log('摄像机启动失败')
            }
        })
    }
    
    //停止
    let stop = document.getElementById('stop');
    stop.onclick = function () {
        camera.stop();
    }
    
    //截图
    let img = document.getElementById('img');
    let cut = document.getElementById('cut');
    cut.onclick = function () {
        camera.cut().then(base64 => {
            img.src = base64
        })
    }
</script>
```

---
_Source: https://npm.io/package/zcamera · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
