Adds ExchangeSDP function to webrtc module

This commit is contained in:
Alexey Khit
2022-08-18 22:46:43 +03:00
parent e70a3629d7
commit 7cdf97c91a
2 changed files with 58 additions and 0 deletions
+9
View File
@@ -186,6 +186,15 @@ func (c *Conn) GetAnswer() (answer string, err error) {
return sdAnswer.SDP, nil
}
func (c *Conn) GetCompleteAnswer() (answer string, err error) {
if _, err = c.GetAnswer(); err != nil {
return
}
<-webrtc.GatheringCompletePromise(c.Conn)
return c.Conn.LocalDescription().SDP, nil
}
func (c *Conn) remote() string {
for _, trans := range c.Conn.GetTransceivers() {
pair, _ := trans.Receiver().Transport().ICETransport().GetSelectedCandidatePair()