Skip to content

Commit 751600e

Browse files
committed
Don't publish if not host
1 parent f2c3880 commit 751600e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Assets/WebGLTemplates/AgoraTemplate/AgoraWebSDK/libs/agorachannel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class AgoraChannel {
184184
),
185185
]);
186186

187-
if (this.videoEnabled) {
187+
if (this.client_role === 1 && this.videoEnabled) {
188188
await this.setupLocalVideoTrack();
189189
if (localTracks.videoTrack != undefined) {
190190
localTracks.videoTrack.play("local-player");
@@ -193,7 +193,7 @@ class AgoraChannel {
193193
this.is_publishing = true;
194194
}
195195

196-
if (this.audioEnabled) {
196+
if (this.client_role === 1 && this.audioEnabled) {
197197
await this.setupLocalAudioTrack();
198198
if (localTracks.audioTrack != undefined) {
199199
await this.client.publish(localTracks.audioTrack);

0 commit comments

Comments
 (0)