Voice Call
  • iOS
  • Android
  • Web
  • Flutter
  • React Native
  • Electron : JavaScript
  • Unity3D
  • Cocos Creator
  • Windows
  • macOS
  • Linux
  • Overview
  • Develop your app
    • Integrate the SDK
    • Implement a basic voice call
  • Upgrade using advanced features
    • Advanced features
      • Mix the streams
  • Resources & Reference
    • SDK
    • Sample code
    • API reference
    • Debugging
    • FAQs
    • Key concepts
  • Documentation
  • Voice Call
  • Resources & Reference
  • Sample code
Sample Code
Download
Note

Instructions for running sample code

This article describes how to quickly run the sample source code and experience basic audio and video calling services.

Prepare the environment

Please ensure that the development environment meets the following technical requirements:

  • Operating system Windows7 or above / macOS 11.0 or above
  • Audio / Video device and internet connection available
  • Node.js installed, LTS version recommended

Get AppID

The AppID required by the SDK are missing in the sample code, please make sure a project has been created in ZEGOCLOUD Console and a valid AppID have been applied.

Run sample code

  1. Open project with Visual Studio Code

  2. The "AppID", "UserID" and "Token" required for SDK initialization are missing from the sample codes, and the /keycenter.js file needs to be modified. Please fill in them correctly, otherwise, the sample code cannot be run. You can get the appID and a temporary token in ZEGOCLOUD Console.

  3. Install dependencies and run

$ npm install
$ npm run start

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