eggm0n
eggm0n

Reputation: 401

Skype for Business Web SDK - participants object empty

When creating a meeting via the Skype for Business Web SDK, the conversation object contains a participants list which contains objects representing the participant details of that meeting. This is working and we can see all the participants that we would expect.

However when joining a meeting that someone else has created via the Skype for Business Web SDK, the participants list is always empty, despite knowing for a fact that there are other users connected to that meeting.

Is this a bug in the SDK? Any help would be appreciated!

Edit: updating with more info after suggestions

we retrieve the conversation object using the following code (note we are retrieving it via a URI):

app.conversationsManager.getConversationByUri(uri);

Here are the outputs from experimenting with the conversation object:

conversation.participants() returns []

conversation.participants returns function [Collection: 0 items]

conversation.participants.get().then(function(participants) {
    console.log(participants)
})

logs Promise {task_ccf0d98018eaf: Task}

Upvotes: 1

Views: 270

Answers (2)

Sid - Microsoft
Sid - Microsoft

Reputation: 136

getConversationByUri doesn't actually join the meeting. It just retrieves a conversation model. You need to actually start one of the services (conversation.chatService.start(), conversation.audioService.start(), etc) in order to join the meeting. Once you join the meeting the participants collection will get updated with people in the meeting.

Upvotes: 1

ShelbyZ
ShelbyZ

Reputation: 1504

There are a few things that could prevent seeing the participants in a conversation/meeting:

  • Events have not posted indicating who is active
  • The collection containing participants has not updated (it is lazy loaded)

If you wanted to get the exact count you would be best served by making a request on the collection similar to:

conv.participants.get().then(function (participants) {
    // participants is an array of currently active persons in the conversation/meeting
});

You could also keep track locally by listening to the added/removed events on the participants collection.

conv.participants.added(function (person) {
    // add to local list...
});

conv.participants.removed(function (person) {
    // remove from local list...
});

If this is not the case it would be interesting to know what code you are using to observe the empty list of participants.

Upvotes: 0

Related Questions