我正在将twilio用作视频聊天应用程序的服务。 该会议室仅可容纳2位参与者P1和P2
P1
连接到房间
let connectOptions = TVIConnectOptions.init(token: payload.twilioAccessToken) { (builder) in
builder.roomName = payload.roomName
}
twilioLog("Will Connect to room with name \(String(describing: payload.roomName))")
self.room = TwilioVideo.connect(with: connectOptions, delegate:self)
func didConnect(to room: TVIRoom)
呼叫成功。
P2
连接到房间
let connectOptions = TVIConnectOptions.init(token: payload.twilioAccessToken) { (builder) in
builder.roomName = payload.roomName
}
twilioLog("Will Connect to room with name \(String(describing: payload.roomName))")
self.room = TwilioVideo.connect(with: connectOptions, delegate:self)
func didConnect(to room: TVIRoom)
呼叫成功。
但是,func room(_ room: TVIRoom, participantDidConnect participant: TVIParticipant)
从未被呼叫。
另外,room.participants返回一个空数组。
答案 0 :(得分:0)
room.remoteParticipants
中的P1。通常,您将需要为每个参与者设置代表以接收来自远程参与者的视频,音频轨道。participantDidConnect
将在P1端被调用。答案 1 :(得分:0)
问题在于P1和P2具有相同的标识符。他们被视为同一参与者