using shared proto types for participant state

This commit is contained in:
David Zhao
2020-11-28 15:17:14 -08:00
parent 1c821853f3
commit 0c99163253
4 changed files with 131 additions and 53 deletions
+2 -2
View File
@@ -114,7 +114,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
room.RemoveParticipant(participant.ID())
}()
case *livekit.SignalRequest_Negotiate:
if participant.State() == rtc.ParticipantStateConnecting {
if participant.State() == livekit.ParticipantInfo_JOINING {
log.Errorw("cannot negotiate before peer offer", "participant", participant.ID())
//conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot negotiate before peer offer"))
return
@@ -127,7 +127,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
case *livekit.SignalRequest_Trickle:
if participant.State() == rtc.ParticipantStateConnecting {
if participant.State() == livekit.ParticipantInfo_JOINING {
log.Errorw("cannot trickle before peer offer", "participant", participant.ID())
//conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot trickle before peer offer"))
return