Core concepts
RTC (Real-Time Communication) refers to real-time communication technology, that allows almost instant exchange of audio, video, and other data between the sender and the receiver.
Agora SDKs provide real-time audio and video interaction services, with multi-platform and multi-device support. This includes high-definition video calls, voice-only calls, interactive live streaming, as well as one-on-one and multi-group chats.
This article introduces the key processes and concepts you need to know to use Agora SDKs.
Using the Agora Console
To use Agora SDKs, create an audio and video project in the Agora Console first. See Agora account management for details.
Agora Console
Agora Console is the main dashboard where you manage your Agora projects and services. Agora Console provides an intuitive interface for developers to query and manage their Agora account. After registering an Agora Account, you use the Agora Console to perform the following tasks:
- Manage the account
- Create and configure Agora projects and services
- Get an App ID
- Manage members and roles
- Check call quality and usage
- Check bills and make payments
- Access product resources
Agora also provides RESTful APIs that you use to implement features such as creating a project and fetching usage numbers programmatically.
General concepts
Agora uses the following basic concepts:
App ID
The App ID is a random string generated within Agora Console when you create a new project. You can create multiple projects in your account; each project has a different App ID. This App ID enables your app users to communicate securely with each other. When you initialize Agora Engine in your app, you pass the App ID as an argument. The App ID is also used to create the authentication tokens that ensure secure communication in a channel. You retrieve your App ID using Agora Console.
Agora uses this App ID to identify each app, provide billing and other statistical data services.
For applications requiring high security in a production environment, you must choose an App ID + Token mechanism for user authentication when creating a new project. Without an authentication token, your environment is open to anyone with access to your App ID.
App certificate
An App certificate is a string generated by Agora Console to enable token authentication. It is required for generating a Video SDK or Signaling authentication token.
To use your App certificate for setting up a token server, see Secure authentication with tokens.
Token
A token is a dynamic key that is used by the Agora authentication server to check user permissions. You use Agora Console to generate a temporary token for testing purposes during the development process. In a production environment, you implement a token server in your security infrastructure to control access to your channels.
For more information, see Secure authentication with tokens.
After obtaining the App ID, App Certificate, and Token in the Agora Console, you can start implementing basic audio and video communication in your app.
Channel
Agora uses the channel name to identify a channel. Users who specify the same channel name join a common channel and interact with each other. A channel is created when the first user joins. It ceases to exist when the last user leaves.
You create a channel by calling the methods for transmitting real-time data. Agora uses different channels to transmit different types of data. The Video SDK channel transmits audio or video data, while the Signaling channel transmits messaging or signaling data. The Video SDK and Signaling channels are independent of each other.
Additional components provided by Agora, such as On-Premise Recording and Cloud Recording, join the Video SDK channel and provide real-time recording, transmission acceleration, media playback, and content moderation.
Channel profile
The SDK applies different optimization methods according to the selected channel profile. Agora supports the following channel profiles:
Channel profile | Description |
---|---|
COMMUNICATION | This profile is suitable for one-on-one or group calls, where all users in the channel talk freely. |
LIVE_BROADCASTING | In a live streaming channel, users have two client roles: host and audience. The host sends and receives audio or video, while the audience only receives audio or video with the sending function disabled. |
Stream
Streams in Flexible Classroom can be understood as audio and video streams and permission to send audio and video streams. Developers can call APIs to give a user permission to perform a specific operation. A user can have multiple streams. For example, a user can have both permission to send audio and video streams captured by local devices and permission to send the video stream from screen capturing.
Developers can call addCoHost
to create a stream for a user and gives the user permission to send the audio or video stream. The Flexible Classroom cloud service automatically generates a stream ID. Developers can call removeCoHost
to permanently destroy a stream and remove permission.
Publish
Publishing is the act of sending a user’s audio or video data to the channel. Usually, the published stream is created by the audio data sampled from a microphone or the video data captured by a camera. You can also publish media streams from other sources, such as an online music file or the user’s screen. After successfully publishing a stream, the SDK continues sending media data to other users in the channel. By publishing the local stream and subscribing to remote streams, users communicate with each other in real-time.
Subscribe
Subscribing is the act of receiving media streams published by remote users to the channel. A user receives audio and video data from other users by subscribing to one or more of their streams. You either directly play the subscribed streams or process incoming data for other purposes such as recording or capturing screenshots.
User ID
A User ID (UID) identifies a user in a channel. Each user in a channel should have a unique user ID. If you do not specify a user ID when the user joins a channel, a UID is automatically generated and assigned to the user.
User
Users are the initiators of behavior in Flexible Classroom. A user has the following properties:
- The user ID: The globally unique identifier of a user in Flexible Classroom.
- The user name: This property is only used for display in a classroom. It can be set as a nickname, Chinese name, or English name.
- The user role: Users have different roles in a classroom, such as the teacher, student, teaching assistant, and audience.
- Customized user properties: In addition to the above properties, developers are free to customize user properties, such as setting the user avatar or gender.
Developers can set the above user properties when calling the launch
method.
User role
A user role is used to define whether users in the channel have permission to publish streams. There are two user roles:
- Host: A user who can publish streams in a channel.
- Audience: A user who cannot publish streams in a channel. Users with this role can only subscribe to remote audio and video streams.
Connection (RtcConnection)
The connection between the SDK and the channel. When you need to publish or receive multiple streams in multiple channels, a connection is used to specify the target channel.
Agora SD-RTN™
Agora's core engagement services are powered by its Software-Defined Real-time Network (SD-RTN™) that is accessible and available anytime, anywhere around the world. The software-defined network isn’t confined by device, phone numbers, or a telecommunication provider’s coverage area like traditional networks. Agora SD-RTN™ has data centers globally that cover over 200+ countries and regions. The network delivers sub-second latency and high availability of real-time video and audio anywhere on the globe. With Agora SD-RTN™, Agora can deliver live user engagement experiences in the form of real-time communication (RTC) with the following advantages:
- Unmatched quality of service
- High availability and accessibility
- True scalability
- Low Cost
Classroom concepts
Room
Rooms in Flexible Classroom are just like the physical classrooms in schools. Classes offered by different teachers with diversified teaching materials can take place in the same room at different times. A school can have different types of classrooms, such as traditional classrooms, laboratories, and multimedia classrooms. Similarly, the rooms of Flexible Classroom can be divided into several types. A room has the following properties:
- The room ID: The globally unique identifier of a room.
- The room name: This property is only used for display in a classroom. It can be set as a Chinese name or an English name.
- The room type: Agora supports three room types: One-to-one Classroom, Small Classroom, and Lecture Hall. These room types vary in features and the upper limit on th number of users.
- Customized room properties: In addition to the above properties, developers are free to customize room properties, such as setting the room status and room label.
Developers can set the above user properties when calling the launch
method. A room is created automatically with the parameters (the room ID, room name, and room type) set by the first user joining the room. To join the same room with the first user, users need to call the launch
method and pass in the same parameters (room ID, room name, and room type). Agora automatically destroys the room one hour after all users leave the room.
Class
Classes in Flexible Classroom are just like the actual classes offered by different teachers in offline teaching scenarios. A class has the following properties:
- The class state: A class has three states: "Not Started", "In Progress", and "Ended".
- The start time: The start time of a class. Before the start time, the class state is "Not Started". After the start time, the class state changes to "In Progress".
- The class duration: How long a class lasts. After the class duration, the class state changes to "Ended".
- The run-late time: How long a room can be open after the class ends. After the run-late time, the room is closed. Users are kicked out of the room immediately, and other users can no longer join the room.
Developers can set the above user properties when calling the launch
method. The class properties are set by the first user joining the room.