# the-camera

> Camera of the-components

Latest version **1.0.7** (published 2017-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install the-camera
pnpm add the-camera
yarn add the-camera
bun add the-camera
```

## 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.7 |
| Published | 2017-12-14 |
| First published | 2017-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 12 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | okunishinishi |
| Maintainers | okunishinishi |
| Keywords | the, react-component |

## Links

- npm: https://www.npmjs.com/package/the-camera
- Repository: https://github.com/the-labo/the-camera
- Homepage: https://github.com/the-labo/the-camera#readme
- Issues: https://github.com/the-labo/the-camera/issues
- npm.io page: https://npm.io/package/the-camera

## Dependencies (12)

- [asobj](https://npm.io/package/asobj.md) ^2.0.2
- [the-spin](https://npm.io/package/the-spin.md) ^2.0.0
- [recordrtc](https://npm.io/package/recordrtc.md) ^5.4.6
- [the-image](https://npm.io/package/the-image.md) ^1.3.3
- [the-style](https://npm.io/package/the-style.md) ^2.0.0
- [the-video](https://npm.io/package/the-video.md) ^2.0.4
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [the-button](https://npm.io/package/the-button.md) ^2.0.5
- [getusermedia](https://npm.io/package/getusermedia.md) ^2.0.1
- [the-condition](https://npm.io/package/the-condition.md) ^2.0.0
- [the-component-util](https://npm.io/package/the-component-util.md) ^2.0.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.7 (latest) — 2017-12-14
- 1.0.6 — 2017-12-13
- 1.0.5 — 2017-12-13
- 1.0.4 — 2017-12-10
- 1.0.3 — 2017-12-10
- 1.0.2 — 2017-12-10
- 1.0.1 — 2017-12-10
- 1.0.0 — 2017-12-09

## README

the-camera
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/the-labo/the-camera
[bd_travis_url]: http://travis-ci.org/the-labo/the-camera
[bd_travis_shield_url]: http://img.shields.io/travis/the-labo/the-camera.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/the-labo/the-camera
[bd_travis_com_shield_url]: https://api.travis-ci.com/the-labo/the-camera.svg?token=
[bd_license_url]: https://github.com/the-labo/the-camera/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/the-labo/the-camera
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/the-labo/the-camera.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/the-labo/the-camera.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/the-labo/the-camera
[bd_gemnasium_shield_url]: https://gemnasium.com/the-labo/the-camera.svg
[bd_npm_url]: http://www.npmjs.org/package/the-camera
[bd_npm_shield_url]: http://img.shields.io/npm/v/the-camera.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

Camera of the-components

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install the-camera --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

```javascript
'use strict'

import React from 'react'
import { TheCamera, TheCameraStyle } from 'the-camera'
import { TheVideoStyle } from 'the-video'
import { TheSpinStyle } from 'the-spin'
import { TheImageStyle } from 'the-image'
import { TheButtonStyle } from 'the-button'

class ExampleComponent extends React.PureComponent {
  constructor (props) {
    super(props)
    const s = this
    s.state = {
      photos: [],
      videos: []
    }
  }

  render () {
    const s = this
    const {photos, videos} = s.state
    return (
      <div>
        <TheVideoStyle/>
        <TheImageStyle/>
        <TheCameraStyle/>
        <TheSpinStyle/>
        <TheButtonStyle/>
        <TheCamera
          onPhoto={(photo) => s.setState({
            photos: [photo, ...s.state.photos]
          })}
          onVideo={(video) => s.setState({
            videos: [video, ...s.state.videos]
          })}
        />
        <hr/>
        <div>
          {
            photos.map((photo, i) => (
              <img src={photo}
                   key={i}
                   height={128}
              />
            ))
          }
          {
            videos.map((video, i) => (
              <video src={video}
                     key={i}
                     height={128}
                     muted
                     controls
              />
            ))
          }
        </div>
      </div>

    )
  }
}

export default ExampleComponent

```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/03.Components.md.hbs" Start -->

<a name="section-doc-guides-03-components-md"></a>

Components
-----------

### TheCamera

Camera of the-components

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `mediaFailMessage` | string  | Message to show when failed to access camera | `'Failed to access camera'` |
| `onPhoto` | func  | Handle photo taken | `` |
| `onVideo` | func  | Handle video taken | `` |

### TheCameraButton



**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `hidden` |   |  | `false` |
| `smaller` |   |  | `false` |

### TheCameraStyle

Style for TheCamera

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `options` | object  | Style options | `{}` |

### TheCameraVideoTime






<!-- Section from "doc/guides/03.Components.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/the-labo/the-camera/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [THE Labo][t_h_e_labo_url]

[t_h_e_labo_url]: https://github.com/the-labo

<!-- Links End -->

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