handles RTC join
This commit is contained in:
+3
-2
@@ -28,7 +28,7 @@ type WebRTCPeer struct {
|
||||
// OnOffer - offer is ready for remote peer
|
||||
OnOffer func(webrtc.SessionDescription)
|
||||
// OnIceCandidate - ice candidate discovered for local peer
|
||||
OnICECandidate func(c *webrtc.ICECandidate)
|
||||
OnICECandidate func(c *webrtc.ICECandidateInit)
|
||||
OnClose func(*WebRTCPeer)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ func NewWebRTCPeer(id string, me *MediaEngine, conf WebRTCConfig) (*WebRTCPeer,
|
||||
return
|
||||
}
|
||||
if peer.OnICECandidate != nil {
|
||||
peer.OnICECandidate(c)
|
||||
ci := c.ToJSON()
|
||||
peer.OnICECandidate(&ci)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ func (r *Room) ToRoomInfo(node *livekit.Node) *livekit.RoomInfo {
|
||||
}
|
||||
|
||||
func (r *Room) Join(peerId string, token string, sdp string) (peer *WebRTCPeer, err error) {
|
||||
// TODO: check token and reject
|
||||
|
||||
r.lock.Lock()
|
||||
defer r.lock.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user