Agora Rtc React Save Abandoned

A react wrapper for Agora RTC NG SDK

Project README

Agora RTC SDK React Wrapper (Archive)

Agora now offers an official React SDK!

The React SDK (2.x) repo is available here.
It's released as v2.x under the same npm package.


1.x (this repo)

A react (react.js) wrapper for Agora RTC NG SDK.

This wrapper supports React >= v16.8

Install

npm install agora-rtc-react

Usage

import React from "react";
import { AgoraVideoPlayer, createClient, createMicrophoneAndCameraTracks } from "agora-rtc-react";

const config = {mode: "rtc", codec: "vp8"}

const useClient = createClient(config);
const useMicrophoneAndCameraTracks = createMicrophoneAndCameraTracks();

const App = () => {
  const client = useClient();
  const { ready, tracks } = useMicrophoneAndCameraTracks();

  return (
    ready && <AgoraVideoPlayer videoTrack={tracks[1]} style={{height: '100%', width: '100%'}} />
  )
}

Example

A full videocall example using the wrapper can be found here.

Reference

You can view the methods in the wrapper here.

Open Source Agenda is not affiliated with "Agora Rtc React" Project. README Source: AgoraIO-Community/Agora-RTC-React
Stars
93
Open Issues
20
Last Commit
5 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating