ID -> SID
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ func (m *RoomManager) CreateRoom(req *livekit.CreateRoomRequest) (r *Room, err e
|
||||
}
|
||||
m.roomLock.Lock()
|
||||
defer m.roomLock.Unlock()
|
||||
m.rooms[r.Id] = r
|
||||
m.rooms[r.Sid] = r
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ func (p *Participant) State() livekit.ParticipantInfo_State {
|
||||
|
||||
func (p *Participant) ToProto() *livekit.ParticipantInfo {
|
||||
info := &livekit.ParticipantInfo{
|
||||
Id: p.id,
|
||||
Sid: p.id,
|
||||
Name: p.name,
|
||||
State: p.state,
|
||||
}
|
||||
|
||||
@@ -112,6 +112,8 @@ func (r *Receiver) rtpWorker() {
|
||||
for {
|
||||
pkt, err := r.track.ReadRTP()
|
||||
if err == io.EOF {
|
||||
// this indicates the track is done on the server side
|
||||
// we should remove the track
|
||||
r.Close()
|
||||
return
|
||||
}
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ func NewRoomForRequest(req *livekit.CreateRoomRequest, config *WebRTCConfig) (*R
|
||||
|
||||
return &Room{
|
||||
Room: livekit.Room{
|
||||
Id: utils.NewGuid(utils.RoomPrefix),
|
||||
Sid: utils.NewGuid(utils.RoomPrefix),
|
||||
EmptyTimeout: req.EmptyTimeout,
|
||||
MaxParticipants: req.MaxParticipants,
|
||||
CreationTime: time.Now().Unix(),
|
||||
@@ -49,7 +49,7 @@ func (r *Room) GetParticipant(id string) *Participant {
|
||||
|
||||
func (r *Room) ToRoomInfo(node *livekit.Node) *livekit.RoomInfo {
|
||||
return &livekit.RoomInfo{
|
||||
Id: r.Id,
|
||||
Sid: r.Sid,
|
||||
NodeIp: node.Ip,
|
||||
CreationTime: r.CreationTime,
|
||||
Token: r.Token,
|
||||
@@ -72,7 +72,7 @@ func (r *Room) Join(participant *Participant) error {
|
||||
log.Infow("new participant joined",
|
||||
"id", participant.ID(),
|
||||
"name", participant.Name(),
|
||||
"roomId", r.Id)
|
||||
"roomId", r.Sid)
|
||||
|
||||
// subscribe participant to existing tracks
|
||||
for _, p := range r.participants {
|
||||
|
||||
Reference in New Issue
Block a user