Video Call
  • iOS
  • Android
  • Web
  • Flutter
  • React Native : JavaScript
  • Electron
  • Unity3D
  • Cocos Creator
  • Windows
  • macOS
  • Linux
  • Overview
  • Develop your app
    • Quick start
    • Enhance basic feature
      • Use Tokens for authentication
  • Upgrade using advanced features
    • Advanced features
      • Improve video quality
        • Visualize the sound level
      • Message signaling
        • Broadcast real-time messages to a room
        • Quotas and limits
      • Play media files
        • Play media files
      • Share the screen
      • Mix the video streams
      • Record video media data
    • Distincitve features
      • Play a transparent gift special effect
  • Resources & Reference
    • SDK
    • Sample codes
    • API reference
      • Client APIs
      • Server APIs
    • Debugging
      • Error codes
    • FAQs
    • Key concepts
  • Documentation
  • Video Call
  • Resources & Reference
  • Sample codes
Sample Code
GitHub
Description

Sample code running guide

Prepare the environment

Please make sure that the development environment meets the following technical requirements:

  • React Native 0.60 or above.
  • iOS devices or simulators with iOS 9.0 or above and support audio and video calling (real devices are recommended).
  • Android devices or emulators with an Android version of 4.4 or above and support audio and video calling (real devices are recommended). If you use a real device, please enable the Allow debugging option.
  • The iOS/Android device is connected to the Internet.
  • Install Node.js. It is recommended that you use the long-term support version shown on the homepage of the official website.

Prerequisites

Please apply for the AppID required to create the engine at ZEGOCLOUD Admin Console.

Run the sample code

  1. Use the VS Code tool to open the project.
  2. Fill in the AppID, userID, and token applied into the /App.js file.
  3. Execute the following command to install and start dependencies.

When you execute the npm install command to install the SDK, and the image download speed from the npm official website is slow, you can execute the npm set registry https://registry.npm.taobao.org/ command to switch it to a local image.

npm install
npx react-native run-android/npx react-native run-ios

Experience real-time audio and video functions

We recommend you run your project on a real device. If your app runs successfully, you should hear the sound and see the video captured locally from your device.

To test out the real-time audio and video features, visit the ZEGO Express Web Demo, and enter the same AppID, Server and RoomID to join the same room. If it runs successfully, you should be able to view the video from both the local side and the remote side, and hear the sound from both sides as well.

In audio-only scenarios, no video will be captured and displayed.

Page Directory