always allow ICE candidates, even before offer

This commit is contained in:
David Zhao
2021-04-16 00:39:22 -07:00
parent e4238890ff
commit 540d1c2e8c

View File

@@ -321,12 +321,6 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici
return
}
case *livekit.SignalRequest_Trickle:
if participant.State() == livekit.ParticipantInfo_JOINING {
logger.Errorw("cannot trickle before offer", "participant", participant.Identity())
//conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot trickle before peer offer"))
return
}
candidateInit := rtc.FromProtoTrickle(msg.Trickle)
//logger.Debugw("adding peer candidate", "participant", participant.ID())
if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil {