sends roominfo on join

This commit is contained in:
David Zhao
2020-12-27 22:38:13 -08:00
parent 94e2c782ee
commit 3fb606236e
7 changed files with 73 additions and 53 deletions
+6 -3
View File
@@ -49,12 +49,15 @@ func (r *Room) GetParticipants() []Participant {
}
func (r *Room) ToRoomInfo(node *livekit.Node) *livekit.RoomInfo {
return &livekit.RoomInfo{
ri := &livekit.RoomInfo{
Sid: r.Sid,
Name: r.Name,
NodeIp: node.Ip,
CreationTime: r.CreationTime,
}
if node != nil {
ri.NodeIp = node.Ip
}
return ri
}
func (r *Room) Join(participant Participant) error {
@@ -103,7 +106,7 @@ func (r *Room) Join(participant Participant) error {
}
}
return participant.SendJoinResponse(otherParticipants)
return participant.SendJoinResponse(r.ToRoomInfo(nil), otherParticipants)
}
func (r *Room) RemoveParticipant(id string) {