2.5.3 • Published 6 months ago

@zegocloud/zego-uikit-prebuilt-live-streaming-rn v2.5.3

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Quick start


npm.io

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

Integrate the SDK

Tutorial | How to build live streaming using React Native in 10 mins with ZEGOCLOUD

Import the SDK

Add @zegocloud/zego-uikit-prebuilt-live-streaming-rn as dependencies

yarn add @zegocloud/zego-uikit-prebuilt-live-streaming-rn 

Add other dependencies

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

yarn add @zegocloud/zego-uikit-rn react-delegate-component zego-express-engine-reactnative

Using the ZegoUIKitPrebuiltLiveStreaming Component in your project

  • Go to ZEGOCLOUD Admin Console|_blank, get the appID and appSign of your project.
  • Specify the userID and userName for connecting the LiveStreaming Kit service.
  • Create a liveID that represents the live streaming you want to make.
  • userID and callID can only contain numbers, letters, and underlines (_).
  • Using the same liveID will enter the same live streaming.
// HostPage.js
import React from 'react';
import { StyleSheet, View } from 'react-native';
import ZegoUIKitPrebuiltLiveStreaming, { HOST_DEFAULT_CONFIG } from '@zegocloud/zego-uikit-prebuilt-live-streaming-rn'

export default function HostPage(props) {
    return (
        <View style={styles.container}>
            <ZegoUIKitPrebuiltLiveStreaming
                appID={yourAppID}
                appSign={yourAppSign}
                userID={userID}
                userName={userName}
                liveID={liveID}

                config={{
                    ...HOST_DEFAULT_CONFIG,
                    onLeaveLiveStreaming: () => { props.navigation.navigate('HomePage') }
                }}
            />
        </View>
    );
}

Configure your project

  • Android:

Open my_project/android/app/src/main/AndroidManifest.xml file and add the code as follow:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
  • iOS:

Open my_project/ios/my_project/Info.plist file and add the code as follow:

<key>NSCameraUsageDescription</key>
<string></string>
<key>NSMicrophoneUsageDescription</key>
<string></string>

Run & Test

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

Related guide

Custom prebuilt UI

Sample code

2.5.3

6 months ago

2.5.2

7 months ago

2.5.1

9 months ago

2.4.4-beta

10 months ago

2.4.3

10 months ago

2.4.5

10 months ago

2.4.4

10 months ago

2.4.1

11 months ago

2.4.0

11 months ago

2.4.2-beta

11 months ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.2

2 years ago

2.1.1

2 years ago

2.0.2

2 years ago

2.0.1-beta.0

2 years ago

2.0.0-beta.0

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.2-beta.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.1-beta.0

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago