# chunky-webcam

> browser client for streaming facial emotions api

Latest version **0.0.2** (published 2021-10-14) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install chunky-webcam
pnpm add chunky-webcam
yarn add chunky-webcam
bun add chunky-webcam
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-10-14 |
| First published | 2016-02-28 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | elsehow |
| Maintainers | elsehow |

## Links

- npm: https://www.npmjs.com/package/chunky-webcam
- npm.io page: https://npm.io/package/chunky-webcam

## Dependencies (2)

- [recordrtc](https://npm.io/package/recordrtc.md) ^5.3.0
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^1.4.5

## Recent versions

- 0.0.2 (latest) — 2021-10-14
- 0.0.1 — 2016-02-28

## README

# chunky webcam 

send .webm recordings from a webcam stream, in chunks of user-specified time, to a socket.io server

## installation

    npm install chunky-webcam

## usage


```javascript
var chunky = require('../index.js')
  , getUserMedia = require('get-user-media')

// get user webcam
getUserMedia({ video: true, audio: false}, (err, stream) => {

    // setup chunky-webcam, with our stream
    // it will record 1000ms chunks,
    // and send them with a 'video' event to 'localhost:9999'
    // where our server runs
    chunk = chunky(stream, 1000, 'localhost:9999')

    console.log('chunky-webcam', chunk)

    // let's say our server will send 'data' events
    chunk.socket.on('data', data => {
        // we will add them to our msg element
        console.log('heard from server!', data)
    })
})
```
*see `examples/` for a robust client/server example.*

## api

### var chunk = chunky(webcam_stream, chunk_duration_ms, uri)

start sending .webm files of length `chunk_duration_ms` to a socket.io server `uri`

takes a [webcam media stream](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API).

the client will emit `'video'` events over the socket.io connection, each containing binary blobs of the video

### chunk.socket

the underlying socket.io connection.

use this to, for example, subscribe to events coming from your socket.io server.
or to emit other kinds of events to this server.

## license

BSD

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