Stream channels
Stream Channels are based on the room model. In a stream channel, users join a topic in order to send message to all users subscribed to that topic. Signaling enables each user to join up to one hundred channels at the same time. Each channel can have unlimited topics and up to 128 simultaneous users. Topics have a higher message transmission rate, greater message concurrency capability, and enable synchronous transmission of audio and video data. You use topics for Metaverse, AR/VR, interactive games, real-time collaboration, and parallel manipulation app.
Understand the tech
The following figure shows the stream channel workflow:
Prerequisites
To follow this page, you must have:
- Setup the Signaling SDK reference app.
Implement communication in a stream channel
This section shows how to use the Signaling SDK to implement stream channels and presence in your app.
-
Set Signaling SDK to connect to Cloud Proxy before you join a channel
To access Agora SD-RTN™ in a restricted network environment, call
setCloudProxy
and pass0
as a parameter to select the automatic mode for transmission. ThesetCloudProxy
method returns0
upon successful initiation of cloud proxy service.To enable the Cloud Proxy service in your app, in
/app/java/com.example.<projectname>/MainActivity
, add the following code afteragoraEngine = RtcEngine.create(config);
:
Test stream channels
To test this functionality:
-
Set the APP ID
In
agora-manager/res/raw/config.json
, setappId
to the AppID of your project. -
Set the authentication method
Choose one of the following authentication methods:
- Temporary token:
- Set
rtcToken
with the value of your temporary token. - Set
channelName
- with the name of a channel you used to create the token.
- Set
- Authentication server:
- Setup an Authentication server
- In
config.json
, set:channelName
with the name of a channel you want to join.rtcToken
to an empty string.serverUrl
to the base URL of your authentication server. For example,https://agora-token-service-production-1234.up.railway.app
.
- Temporary token:
-
Start the Android reference app
-
In Android Studio, connect a physical Android device to your development machine.
-
Click Run to start the app.
A moment later you see the project installed on your device. If this is the first time you run the project, you need to grant microphone and camera access to your app.
-
-
In Android Studio, open
app/java/com.example.<projectname>/MainActivity
, and updateappId
,channelName
andtoken
with the values for your temporary token. -
Connect a physical Android device to your development device.
-
In Android Studio, click Run app. A moment later you see the project installed on your device.
If this is the first time you run the project, grant microphone and camera access to your app.
- Click Join to start a call.
You see your app starts the proxy service and magically connects to the Agora SD-RTN™ which was not possible in a restricted network environment.
Reference
This section contains information that completes the information in this page, or points you to documentation that explains other aspects to this product.