voxeet / voxeet-sdk-web

The Dolby.io Communications SDK for Web.
https://www.npmjs.com/package/@voxeet/voxeet-web-sdk
Other
4 stars 2 forks source link

Unable to get participants using the sdk #23

Closed weiz18 closed 1 year ago

weiz18 commented 1 year ago

Issue

Hey, on the latest version of the sdk, we are getting the following error when trying to access a list of participants (https://docs.dolby.io/communications-apis/docs/js-client-sdk-conferenceservice#participants)

How to reproduce conference.participants.forEach

Error

Conference creation error TypeError: Cannot read properties of undefined (reading 'call') at get participants [as participants] (voxeet-sdk.js:2:1029478)

Thanks !

FabienLavocat commented 1 year ago

Try this syntax:

[...VoxeetSDK.conference.participants].forEach((p) => console.log(p));
weiz18 commented 1 year ago

Thanks @FabienLavocat , that works. does that always return current conference ? i also tried [...VoxeetSDK.conference.current.participants] to have the current conference but seems to be failing

FabienLavocat commented 1 year ago

I was able to get this code to work without any issues

VoxeetSDK.conference.current.participants.forEach((o, key) => console.log(key, o));

Which is similar to:

VoxeetSDK.conference.participants.forEach((o, key) => console.log(key, o));

Could you please share a full code snippet from your app that is failing.

weiz18 commented 1 year ago

Hey, @FabienLavocat, manage to find the cause. we were using promising chaining before and the conference must not be modified properly when joining a conference. all good now. thanks for your help !