Skip to content

twilio/react-native-twilio-video-webrtc

 
 

Repository files navigation

Twilio Video (WebRTC) for React Native

This is a Twilio-maintained fork of blackuy/react-native-twilio-video-webrtc. This React Native SDK allows you to add real-time video calling to your React Native apps. If you are new to Twilio Video, check out the developer documentation here.

GitHub License NPM version

Platforms:

  • iOS
  • Android

Install Node Package

NPM version

Option A: yarn

yarn add react-native-twilio-video-webrtc

Option B: npm

npm install react-native-twilio-video-webrtc

Usage with Expo

To use this library with Expo we recommend using our config plugin that you can configure like the following example:

{
  "name": "my app",
  "plugins": [
    [
      "react-native-twilio-video-webrtc",
      {
        "cameraPermission": "Allow $(PRODUCT_NAME) to access your camera",
        "microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone"
      }
    ]
  ]
}

Also, you will need to install expo-build-properties package:

npx expo install expo-build-properties

Expo Config Plugin Props

The plugin support the following properties:

  • cameraPermission: Specifies the text to show when requesting the camera permission to the user.

  • microphonePermission: Specifies the text to show when requesting the microphone permission to the user.

Permissions

To enable camera usage and microphone usage you will need to add the following entries to your Info.plist file:

<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microphone is accessed for the first time</string>

Docs

You can see the API documentation here.

Usage

We have three important components to understand:

import {
  TwilioVideo,
  TwilioVideoLocalView,
  TwilioVideoParticipantView,
} from "react-native-twilio-video-webrtc";
  • TwilioVideo / is responsible for connecting to rooms, events delivery and camera/audio.
  • TwilioVideoLocalView / is responsible for the local camera feed
  • TwilioVideoParticipantView / is responsible for a remote peer's camera feed

The Example App provides an example how the Video React Native SDK can be used. Please check out the Example App's README for more details.

License

See LICENSE

About

Twilio Video (WebRTC) for React Native

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 45.4%
  • Objective-C 23.1%
  • JavaScript 19.2%
  • TypeScript 9.4%
  • Ruby 1.2%
  • Kotlin 1.1%
  • Swift 0.6%