Skype for Business Web SDK - 参与者 object 为空

Skype for Business Web SDK - participants object empty

当通过 Skype for Business Web SDK 创建会议时,conversation object 包含一个 participants 列表,其中包含 objects 代表会议的参与者详细信息会议。这很有效,我们可以看到我们期望的所有参与者。

然而,当加入 其他人通过 Skype for Business Web SDK 创建的会议时,participants 列表总是空的,尽管知道一个事实还有其他用户连接到该会议。

这是 SDK 中的错误吗?如有任何帮助,我们将不胜感激!

编辑:根据建议更新更多信息

我们使用以下代码检索 conversation object(注意我们通过 URI 检索它):

app.conversationsManager.getConversationByUri(uri);

以下是使用 conversation object:

进行实验的输出

conversation.participants() returns []

conversation.participants returns function [Collection: 0 items]

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

日志Promise {task_ccf0d98018eaf: Task}

有几件事可能会阻止在 conversation/meeting 中看到参与者:

  • 活动尚未发布,表明谁是活跃的
  • 包含参与者的集合尚未更新(它是延迟加载的)

如果您想获得准确的计数,您最好通过对集合发出类似于以下内容的请求来获得服务:

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

您还可以通过收听参与者集合中的 added/removed 事件来在本地跟踪。

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

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

如果不是这种情况,那么了解您使用什么代码来观察参与者的空列表会很有趣。

getConversationByUri 实际上没有加入会议。它只是检索一个对话模型。您需要实际启动其中一项服务(conversation.chatService.start()conversation.audioService.start() 等)才能加入会议。您加入会议后,与会者 collection 将获得与会人员的最新信息。