Complete parsing of WHIP candidates.

This commit is contained in:
Juliusz Chroboczek
2023-12-20 01:42:11 +01:00
parent be2d3ab4ca
commit dc34350d8f
2 changed files with 24 additions and 15 deletions
+1 -11
View File
@@ -193,17 +193,7 @@ func (c *WhipClient) gotOffer(ctx context.Context, offer []byte) ([]byte, error)
return []byte(conn.pc.CurrentLocalDescription().SDP), nil
}
func (c *WhipClient) GotICECandidate(candidate, ufrag []byte) error {
zero := uint16(0)
init := webrtc.ICECandidateInit{
Candidate: string(candidate),
SDPMLineIndex: &zero,
}
if ufrag != nil {
u := string(ufrag)
init.UsernameFragment = &u
}
func (c *WhipClient) GotICECandidate(init webrtc.ICECandidateInit) error {
c.mu.Lock()
defer c.mu.Unlock()
if c.connection == nil {