@zegocloud/zego-uikit-prebuilt-live-audio-room-rn
TypeScript icon, indicating that this package has built-in type declarations

2.5.0 • Public • Published

Overview


If you have any questions regarding bugs and feature requests, visit the ZEGOCLOUD community .

Live Audio Room Kit is a prebuilt component that helps you to build full-featured live audio rooms into your apps easier.

And it includes the business logic along with the UI, enabling you to customize your live audio apps faster with more flexibility.

/Pics/ZegoUIKit/Flutter/live_with_cohosting2.gif

When do you need the Live Audio Room Kit

  • When you want to build live audio rooms easier and faster, it allows you:

    Build or prototype live audio apps ASAP

    Finish the integration in the shortest possible time

  • When you want to customize UI and features as needed, it allows you:

    Customize features based on actual business needs

    Spend less time wasted developing basic features

    Add or remove features accordingly

To build a live audio app from scratch, you may check our Voice Call.

Embedded features

  • Ready-to-use Live Audio Room
  • Remove speakers
  • Speaker seats changing & management
  • Customizable seat layout
  • Extendable menu bar
  • Device management
  • Customizable UI style
  • Real-time interactive text chat
  • Seat-taking (Invite & apply to take speaker seats)

Quick start


Prerequisites

  • Go to ZEGOCLOUD Admin Console, and do the following:
    • Create a project, get the AppID and AppSign.
    • Activate the In-app Chat service (as shown in the following figure).

ActivateZIMinConsole

Integrate the SDK

Import the SDK

  1. Add @zegocloud/zego-uikit-prebuilt-live-audio-room-rn as dependencies.
yarn add @zegocloud/zego-uikit-prebuilt-live-audio-room-rn
  1. Add other dependencies.

Run the following command to install other dependencies for making sure the @zegocloud/zego-uikit-prebuilt-live-audio-room-rn can work properly:

yarn add react-delegate-component zego-express-engine-reactnative@3.2.0 zego-zim-react-native@2.7.0 zego-zpns-react-native@2.2.0 @zegocloud/zego-uikit-rn @zegocloud/zego-uikit-signaling-plugin-rn

Using the ZegoUIKitPrebuiltLiveAudioRoom Component in your project

  • Specify the userID and userName for connecting the Live Audio Room Kit service.
  • Create a roomID that represents the room you want to make.
  • userID, userName and roomID can only contain numbers, letters, and underlines (_).
  • Users that join the room with the same roomID can talk to each other.
// App.js
import React, { Component } from 'react';
import { View } from 'react-native';
import ZegoUIKitPrebuiltLiveAudioRoom, {
  HOST_DEFAULT_CONFIG,
} from '@zegocloud/zego-uikit-prebuilt-live-audio-room-rn';

export default function LiveAudioRoomPage(props) {
  return (
    <View style={styles.container}>
      <ZegoUIKitPrebuiltLiveAudioRoom
        appID={yourAppID}
        appSign={yourAppSign}
        userID={userID} // userID can be something like a phone number or the user id on your own user system.
        userName={userName}
        roomID={roomID} // roomID can be any unique string.
        config={{
          ...HOST_DEFAULT_CONFIG,
          onLeaveConfirmation: () => {
            props.navigation.navigate('HomePage');
          },
        }}
      />
    </View>
  );
}

Configure your project

  • Android:
  1. Open the my_project/android/app/src/main/AndroidManifest.xml file and add the following:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
  1. Open the my_project/android/app/proguard-rules.pro file and add the following:

-keep class **.zego.**  { *; }
  • iOS:
  1. Open the my_project/ios/my_project/Info.plist file and add the following:

<key>NSCameraUsageDescription</key>
<string>We need to use the camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need to use the microphone</string>
  1. Disable the Bitcode.

a. Open the your_project > ios > [your_project_name].xcworkspace file.

b. Select your target project, and follow the notes on the following two images to disable the Bitcode respectively.

Run & Test

If your device is not performing well or you found a UI stuttering, run in Release mode for a smoother experience.

  • Run on an iOS device:
yarn ios
  • Run on an Android device:
yarn android

Related guide

Custom prebuilt UI

Resources

Package Sidebar

Install

npm i @zegocloud/zego-uikit-prebuilt-live-audio-room-rn

Weekly Downloads

5

Version

2.5.0

License

MIT

Unpacked Size

753 kB

Total Files

179

Last publish

Collaborators

  • kaelding
  • tilince
  • ttzhang
  • listen936
  • diggingking