Render the View

The render() method generates the UI elements within its return statement. Define any required Agora engine settings in the code that precedes return .

render() {

...

return (

...

);

}

Create the RTC Engine

Before rendering the view, create the Agora RTC engine, as shown here.

AgoraRtcEngine.createEngine('YOUR APP ID');

The YOUR APP ID is the same app ID used in the Quick Start.

Enable Audio and Video

After creating the RTC Engine, enable the video and audio, as shown here.

AgoraRtcEngine.enableVideo();

AgoraRtcEngine.enableAudio();

Set Video and Channel Profiles

Set the video and channel profile, as shown here.

AgoraRtcEngine.setVideoProfileDetail(360, 640, 15, 300);

AgoraRtcEngine.setChannelProfile(AgoraRtcEngine.AgoraChannelProfileCommunication);

The sample app sets the following values for the video profile:

Width: 360

Height: 640

Frame rate: 15

Bitrate: 300

To learn more, see the React Native API doc.