tuananhcwrs / opentok-react-native-1

React Native live video streaming demo app using Open-Tok

Home Page:https://medium.com/spritle-software/build-a-simple-video-streaming-app-with-opentok-react-native-1c966c5af915

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native - Open Tok Example

A simple React Native app using openTok to perform live audio-video streaming. This example includes both Publisher and Subscriber component.

Open Tok

OpenTok is video platform tool from TokBox community to easily integrate high-quality video,audio streaming with your web or mobile apps.

OpenTok uses WebRTC technology for audio,video communications. OpenTok supports web,iOS,android and windows apps.

To run this example,

  • Clone this repo git clone

  • git clone git@github.com:prabakarviji/OpenTok_RN.git

  • cd openTok_RN

  • run npm install or yarn install

  • Link open-tok library by react-native link react-native-opentok

    For iOS

    • cd ios then install open-tok pod by pod install
    • Open TokBot.xcworkspace in XCode and run it.

Usage

Publisher Component

<Publisher
    sessionId={sessionId}
    mute={this.state.isAudioMute}
    onPublishStart={() => { console.log('Streaming Started')}}
    onPublishStop={() => { console.log('Streaming Stopped')}}
    onPublishError={() => { console.log('Streaming Error')}}
    style={{backgroundColor: 'black',height:height, width: width,  }}
    ref={ref => {
      this.ref = ref;
    }}
/>

Subscriber Component

<Subscriber
    sessionId={sessionId}
    onSubscribeStart={() => { console.log('Watching started')}}
    onSubscribeStop={() => { console.log('Watching started')}
    onSubscribeError={() => { console.log('Watching started')}
    style={{backgroundColor: 'black',height:height, width: width,  }}
    ref={ref => {
      this.ref = ref;
    }}
/>

Thanks to CallStack community for this wonderful React Native Open-Tok wrapper

About

React Native live video streaming demo app using Open-Tok

https://medium.com/spritle-software/build-a-simple-video-streaming-app-with-opentok-react-native-1c966c5af915


Languages

Language:JavaScript 55.4%Language:Objective-C 23.6%Language:Starlark 9.2%Language:Java 8.5%Language:Ruby 3.2%