Fix poorly named function in RTCPeerConnection

CreateOffer -> CreateAnswer currently `pion-WebRTC` can only generate
offers not answers.
This commit is contained in:
Sean DuBois
2018-07-04 00:46:01 -07:00
parent 3b3ed9a544
commit 24a312c34d
4 changed files with 8 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ func main() {
}
// Sets the LocalDescription, and starts our UDP listeners
if err := peerConnection.CreateOffer(); err != nil {
if err := peerConnection.CreateAnswer(); err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
}
// Sets the LocalDescription, and starts our UDP listeners
if err := peerConnection.CreateOffer(); err != nil {
if err := peerConnection.CreateAnswer(); err != nil {
panic(err)
}

View File

@@ -57,7 +57,7 @@ func main() {
}
// Sets the LocalDescription, and starts our UDP listeners
if err := peerConnection.CreateOffer(); err != nil {
if err := peerConnection.CreateAnswer(); err != nil {
panic(err)
}

View File

@@ -83,9 +83,12 @@ func (r *RTCPeerConnection) SetRemoteDescription(rawSessionDescription string) e
}
// CreateOffer starts the RTCPeerConnection and generates the localDescription
// The order of CreateOffer/SetRemoteDescription determines if we are the offerer or the answerer
// Once the RemoteDescription has been set network activity will start
func (r *RTCPeerConnection) CreateOffer() error {
return errors.Errorf("CreateOffer is not implemented")
}
// CreateAnswer starts the RTCPeerConnection and generates the localDescription
func (r *RTCPeerConnection) CreateAnswer() error {
if r.tlscfg != nil {
return errors.Errorf("tlscfg is already defined, CreateOffer can only be called once")
}