# the-talk

> Talking via webrtc

Latest version **5.0.0** (published 2018-12-10) · MIT license · 0 weekly downloads

## Install

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

## 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 | 5.0.0 |
| Published | 2018-12-10 |
| First published | 2018-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 13 |
| Unpacked size | 4.8 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | okunishinishi |
| Maintainers | okunishinishi |
| Keywords | react-component, the |

## Links

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

## Dependencies (13)

- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [asobj](https://npm.io/package/asobj.md) ^3.0.0
- [the-icon](https://npm.io/package/the-icon.md) ^4.0.10
- [the-spin](https://npm.io/package/the-spin.md) ^3.1.12
- [the-check](https://npm.io/package/the-check.md) ^2.0.17
- [the-style](https://npm.io/package/the-style.md) ^2.2.3
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2
- [the-button](https://npm.io/package/the-button.md) ^3.0.32
- [the-window](https://npm.io/package/the-window.md) ^7.0.1
- [webrtc-adapter](https://npm.io/package/webrtc-adapter.md) ^7.0.0
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.0.0
- [the-component-util](https://npm.io/package/the-component-util.md) ^3.0.20

## 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

- 5.0.0 (latest) — 2018-12-10
- 3.0.2 — 2018-08-15
- 4.0.2 — 2018-08-15
- 4.0.1 — 2018-08-15
- 4.0.0 — 2018-08-13
- 3.0.1 — 2018-07-30
- 3.0.0 — 2018-07-28
- 2.3.5 — 2018-06-18
- 2.3.4 — 2018-05-23
- 2.3.3 — 2018-05-22
- 2.3.2 — 2018-05-22
- 2.3.1 — 2018-05-22
- 2.3.0 — 2018-05-22
- 2.2.7 — 2018-05-12
- 2.2.6 — 2018-05-12
- … 20 more at https://npm.io/package/the-talk/versions

## README

the-talk
==========

<!---
This file is generated by the-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-talk
[bd_travis_url]: http://travis-ci.org/the-labo/the-talk
[bd_travis_shield_url]: http://img.shields.io/travis/the-labo/the-talk.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/the-labo/the-talk
[bd_travis_com_shield_url]: https://api.travis-ci.com/the-labo/the-talk.svg?token=
[bd_license_url]: https://github.com/the-labo/the-talk/blob/master/LICENSE
[bd_npm_url]: http://www.npmjs.org/package/the-talk
[bd_npm_shield_url]: http://img.shields.io/npm/v/the-talk.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>

Talking via webrtc

<!-- 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-talk --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 { TheTalk, TheTalkStyle } from 'the-talk'
import { TheSpinStyle } from 'the-spin'
import { TheButtonStyle } from 'the-button'
import { TheRTCClient } from 'the-rtc-client'

class ExampleComponent extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      localClient: null,
      remoteClients: {}
    }
    this.renderRemoteClient = this.renderRemoteClient.bind(this)
    this.rtcClient = null
    this.renderLocalClient = this.renderLocalClient.bind(this)
  }

  componentDidMount () {
    void this.joinToTalk()
  }

  async joinToTalk () {
    const rtcClient = new TheRTCClient({
      // Additional info
      info: {
        userAgent: navigator.userAgent,
        who: `user-${new Date().getTime()}`
      },
      onLocal: (localClient) => {
        this.setState({localClient})
      },
      onRemote: (remoteClient) => {
        const {rid} = remoteClient
        this.setState({
          remoteClients: {
            ...this.state.remoteClients,
            [rid]: remoteClient,
          },
        })
      }
    })
    await rtcClient.connect(`http://localhost:3000`)
    await rtcClient.join(`the-talk-example-room-${new Date().getFullYear()}`)
    this.rtcClient = rtcClient
  }

  render () {
    const {localClient, remoteClients} = this.state
    return (
      <div>
        <TheSpinStyle/>
        <TheButtonStyle/>
        <TheTalkStyle/>
        <TheTalk {...{localClient, remoteClients}}
                 onToggleVideo={(videoEnabled) => this.rtcClient.toggleVideoEnabled(videoEnabled)}
                 onToggleAudio={(audioEnabled) => this.rtcClient.toggleAudioEnabled(audioEnabled)}
                 renderRemoteClient={this.renderRemoteClient}
                 renderLocalClient={this.renderLocalClient}
        />
      </div>

    )
  }

  renderRemoteClient (state) {

  }

  renderLocalClient ({info}) {
    return (
      <span>{`${info.who} (${info.userAgent})`}</span>
    )
  }
}

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
-----------

### TheTalk

Talking via webrtc

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `localClient` | object  | Handle video | `null` |
| `onVideo` | func  |  | `` |
| `remoteClients` | objectOf object |  | `{}` |
| `renderLocalClient` | func  |  | `() => null` |
| `renderRemoteClient` | func  |  | `() => null` |
| `videoHeight` | union  | Height of video | `` |
| `localVideoHeight` |   |  | `100` |
| `remoteVideoHeight` |   |  | `200` |

### TheTalkStyle

Style for TheTalk

**Props**

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



<!-- 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-talk/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-talk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
