Skip to content

Commit 844a7b2

Browse files
authored
825-broadcast-streaming-quickstart (#1515)
1 parent 0284121 commit 844a7b2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

shared/video-sdk/get-started/get-started-sdk/project-implementation/react-js.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,19 @@ export const VideoCalling = () => {
7474
</ProductWrapper>
7575

7676
<ProductWrapper product="broadcast-streaming">
77-
For <Vpd k="NAME" />, set the `mode` property of `ClientConfig` to `"live"` and the `role` to `"host"` or `"audience"`.
77+
For <Vpd k="NAME" />, set the `mode` property of `ClientConfig` to `"live"`, the client `role` to `"host"` or `"audience"` and the audience latency `level` to `1`.
7878

7979
```jsx
8080
export const BroadcastStreaming = () => {
8181
const client = AgoraRTC.createClient({ mode: "live", codec: "vp8" });
82+
83+
// Set the client role and latency level
84+
// Join as audience
85+
client.setClientRole("audience", { level: 1 });
86+
87+
// To join as a host, use:
88+
// client.setClientRole("host");
89+
8290
return(
8391
<AgoraRTCProvider client={client}>
8492
<Basics />

shared/video-sdk/get-started/get-started-sdk/project-implementation/web.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ When you join as a host, you can publish local media streams in the channel; you
8888
// Join as a host
8989
async function joinChannel() {
9090
await client.join(appId, channel, token, uid);
91-
// Set low latency level for broadcast streaming
92-
let clientRoleOptions = { level: 1 };
9391
// A host can both publish tracks and subscribe to tracks
9492
client.setClientRole("host", clientRoleOptions);
9593
// Create and publish local tracks
@@ -108,7 +106,7 @@ When you join as a host, you can publish local media streams in the channel; you
108106
async function joinAsAudience() {
109107
await client.join(appId, channel, token, uid);
110108

111-
// Low latency level for broadcast streaming
109+
// Low audience latency level for broadcast streaming
112110
let clientRoleOptions = { level: 1 };
113111
// Audience can only subscribe to tracks
114112
client.setClientRole("audience", clientRoleOptions);

0 commit comments

Comments
 (0)