react-native-agora-rawdata

The rawdata plugin for react-native-agora


Keywords
react-native, agora, capture, audio, video, frame
License
MIT
Install
npm install react-native-agora-rawdata@0.2.0

Documentation

react-native-agora-rawdata

The rawdata plugin for react-native-agora.

Important

The plugin only exports four methods to the javascript layer that can register or unregister the observer.

type AgoraRawdataType = {
  registerAudioFrameObserver(engineHandle: number): Promise<void>;

  unregisterAudioFrameObserver(): Promise<void>;

  registerVideoFrameObserver(engineHandle: number): Promise<void>;

  unregisterVideoFrameObserver(): Promise<void>;
};

The plugin changes the color of the video stream by the default:

  • Change local video to green
  • Change remote video to pink

You can find the code at:

If you can program with C++, you should process raw data on the C++ layer to improve performance and remove code about calling Android and iOS.

You can find the code at:

Installation

npm install react-native-agora-rawdata

You should fork this repository, and modify the code to implement your requirement, such as use third-party beauty SDK.

Usage

import AgoraRawdata from "react-native-agora-rawdata";
import RtcEngine from 'react-native-agora';

const agora = await RtcEngine.create(appId);
await AgoraRawdata.registerAudioFrameObserver(
  await agora.getNativeHandle()
);
await AgoraRawdata.registerVideoFrameObserver(
  await agora.getNativeHandle()
);

Resources

  • Doc for react-native-agora
  • Doc for Android raw video data
  • Doc for iOS raw video data

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT