API-Examples-Web icon indicating copy to clipboard operation
API-Examples-Web copied to clipboard

setClientRole not working after joining a channel

Open jatintaggbox opened this issue 3 years ago • 1 comments

Hello all,

if I use client.setClientRole after joining a channel and then use client.publish() it says "AgoraRTCError INVALID_OPERATION: audience can not publish stream";

I think we can use setClientRole after joining as an audience. I am using "agora-rtc-sdk-ng" version "^4.7.0" for Agora SDK. Please help if it is bug or I am doing something wrong.

Thank you in advance

jatintaggbox avatar Sep 27 '21 14:09 jatintaggbox

i believe setClientRole is an async function. have you waited till it finished before calling publish?

plutoless avatar Sep 30 '21 01:09 plutoless