diff --git a/README.md b/README.md index 82ae1dc..06b8e8e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@ -# agora-react-uikit +# Agora React Web UIKit -> A React based UIKit for the Agora Web SDK +> Instantly integrate Agora video calling or streaming into your web application using a React based UIKit for the Agora Web SDK. [![NPM](https://img.shields.io/npm/v/agora-react-uikit.svg)](https://www.npmjs.com/package/agora-react-uikit) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ## Getting started - ### Requirements - [An Agora developer account](https://sso.agora.io/en/signup?utm_source=github&utm_repo=Agora-React-Web-UIKit) - A React project -- A Modern Web Browser You can also use the UIKit outside a React project (for example in a vanilla-js project) using web-components. Find out more in the `/web-component` directory. + ### Installation -To a react app (generated using create-react-app) add the UIKit: +To a react application, add the following: ```bash npm i agora-react-uikit @@ -21,44 +20,45 @@ npm i agora-react-uikit ### Usage -This UIKit is very simple to use and contains a high level component called `AgoraUIKit`. You can check out code explanation here. +This UIKit contains a high level component called `AgoraUIKit`. You can check out code explanation here. **A simple sample app integrating Agora UI Kit:** ```jsx -import React, { useState } from 'react' -import AgoraUIKit, { layout } from 'agora-react-uikit' +import React, {useState} from 'react'; +import AgoraUIKit from 'agora-react-uikit'; const App = () => { - const [videocall, setVideocall] = useState(true) - - return videocall ? ( -
Generated using TypeDoc
++ + + +Instantly integrate Agora video calling or streaming into your web application using a React based UIKit for the Agora Web SDK.
+
You can also use the UIKit outside a React project (for example in a vanilla-js project) using web-components. Find out more in the /web-component
directory.
To a react application, add the following:
+npm i agora-react-uikit
+
+
+
+ This UIKit contains a high level component called AgoraUIKit
. You can check out code explanation here.
A simple sample app integrating Agora UI Kit:
+import React, {useState} from 'react';
import AgoraUIKit from 'agora-react-uikit';
const App = () => {
const [videoCall, setVideoCall] = useState(true);
const rtcProps = {
appId: '<Agora App ID>',
channel: 'test',
token: '<Your Agora Token>' // skip if you're using an app in testing mode
};
const callbacks = {
EndCall: () => setVideoCall(false),
};
return videoCall ? (
<AgoraUIKit rtcProps={rtcProps} callbacks={callbacks} />
) : (
<Text onPress={()=>setVideoCall(true)}>Start Call</Text>
);
};
export default App;
+
+Insert your Agora AppID and Token.
+ + +There's a demo project in the repo here.
+ + +/example/src/App.tsx
npm start
to start the bundler to build the librarycd example && npm start
to run the example appFor full documentation, see our docs page.
+You can visit the wiki for other examples and in depth guide.
+Generated using TypeDoc
Generated using TypeDoc
Props object for customising the UI Kit functionality
+React functional component for overriding the default video placeholder
+Set to true to enable active speaker callback, switches the pinned video to active speaker if you're using the pinned layout. (default: false)
+Agora App ID - used to authenticate the request
+Once set to true, the UI Kit attempts to join the channel. Can be set to false to initialise the SDK and wait before joining the channel. (default: true)
+Channel name to join - users in the same channel can communicate with each other
+Pass in a custom RTC client, to use your own implementation of the AgoraRTCClient.
+Enable dual stream mode with selected fallback option. (default: disabled)
+Enable the mic before joining the call. (default: true)
+Enables dual stream mode. (default: false)
+Enable the camera before joining the call. Only use for initiak(default: true)
+Choose between grid layout and pinned layout. (default: pinned layout)
+Set local user's role between audience and host. Use with mode set to livestreaming. (default: host)
+(optional) Token used to join a channel when using secured mode (default: null)
+(optional) URL for token server, manages fetching and updating tokens automatically. Must follow the schema here - https://github.com/AgoraIO-Community/agora-token-service/
+(optional) UID for local user to join the channel (default: 0)
+Generated using TypeDoc
Props object for customising the UI Kit, takes in react native styling
+Globals style for the local buttons (except end call)
+Applies style to the global view containing the UI Kit
+Custom base64 string for icon
+Applies style to the individual cell (view) containing the video in the grid layout
+Applies style to the grid container
+Color tint for icons
+Style for the local button container
+Style for specific local buttons, overrides the style applied by BtnTemplateStyles prop
+Style for the big view container
+Style for the overlay on small user view when pressed in pinned layout
+Style for the big view in pinned layout
+Style for the small view container
+Style for the overlay on small user view when pressed in pinned layout
+Style for the small view in pinned layout
+Applies style to the grid container
+Style for the remote button container
+Style for the remote button
+Applies style to the pinned scrollview container
+Color tint for icons
+Sets the scaling of the video
+Generated using TypeDoc
Generated using TypeDoc
High level component to render the UI Kit
+Generated using TypeDoc
You're {role ? 'an audience' : 'a host'}
-setRole(!role)}>Change Role
+You're {isHost ? 'a host' : 'an audience'}
+setHost(!isHost)}>Change Role
setPinned(!isPinned)}>Change Layout
Select a pre built layout
+