How to join a session as a host with Web Video SDK (instant)?

There is no host on any sessions joined.
Even when changing the topic or password.
Based on other forum topic (49275) it is suppose that the first participant joining a topic will be a host.

Error

  • On every joined session when calling client.getCurrentUserInfo() i can see that isHost: false.
  • Since there is no host there is no way to set the chat privilege so i get the error INSUFFICIENT_PRIVILEGES: only host or co-host can do the operation.

Which Web Video SDK version?
1.0.3

To Reproduce

this.client = ZoomVideo.createClient();

const signature = generateInstantToken(
  this.APP_ZOOM_KEY,
  this.APP_ZOOM_SECRET,
  session_name,
  password
);

(async () => {
    await this.client.init('en-US', this.APP_URL+'dist/lib');
    await this.client
      .join(session_name, signature, user_name, password)
      .then(async () => {
        console.log('join success', this.client.getCurrentUserInfo());

        //this.client.makeHost(this.currentUserInfo.userId);

        this.chat = this.client.getChatClient();
        if(this.chat) {
          
          this.chat
            .setPrivilege(this.MEETING_PRIVILEGE_ALL)
            .then((v) => {
              this.chat.sendToAll('test');
            })
            .catch((v) => {
              console.error(v);
            });
        }
      });
})();

Device:

  • Device: Desktop
  • OS: Windows
  • Browser: Firefox, Chrome

I just find out that weirdly on joining a session there is multiple event triggered and at some point there is one that the participant is the host.

this.client = ZoomVideo.createClient();

this.client.on('connection-change', async (payload) => {
  console.log('connection-change', payload);
});

this.client.on('user-added', (payload) => {
  console.log('user-added', 'isHost: '+payload[0].isHost);
});

(async () => {
    await this.client.init('en-US', this.APP_URL+'dist/lib');
    await this.client
      .join(session_name, signature, user_name, password)
      .then(async () => {
        console.log('join()', 'isHost: '+this.client.getCurrentUserInfo().isHost);
      })
      .catch((error) => {
          console.error(error);
      });
})();

Capture

So when joining the participant is not the host and then the event user-added is called two times (even if it’s the same participant) and on the last event it is marked as the host.

Hey @Fran6 ,

You can also checkout our docs here to manage the users roles, including a host:

Thanks,
Tommy

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.