mirror of
https://github.com/pion/webrtc.git
synced 2025-10-06 23:52:51 +08:00
Fix poorly named function in RTCPeerConnection
CreateOffer -> CreateAnswer currently `pion-WebRTC` can only generate offers not answers.
This commit is contained in:
@@ -55,7 +55,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sets the LocalDescription, and starts our UDP listeners
|
// Sets the LocalDescription, and starts our UDP listeners
|
||||||
if err := peerConnection.CreateOffer(); err != nil {
|
if err := peerConnection.CreateAnswer(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sets the LocalDescription, and starts our UDP listeners
|
// Sets the LocalDescription, and starts our UDP listeners
|
||||||
if err := peerConnection.CreateOffer(); err != nil {
|
if err := peerConnection.CreateAnswer(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sets the LocalDescription, and starts our UDP listeners
|
// Sets the LocalDescription, and starts our UDP listeners
|
||||||
if err := peerConnection.CreateOffer(); err != nil {
|
if err := peerConnection.CreateAnswer(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,9 +83,12 @@ func (r *RTCPeerConnection) SetRemoteDescription(rawSessionDescription string) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateOffer starts the RTCPeerConnection and generates the localDescription
|
// 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 {
|
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 {
|
if r.tlscfg != nil {
|
||||||
return errors.Errorf("tlscfg is already defined, CreateOffer can only be called once")
|
return errors.Errorf("tlscfg is already defined, CreateOffer can only be called once")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user