Skip to content

Commit 2585a2f

Browse files
jechSean-Der
authored andcommitted
Improve the documentation of NewPeerConnection
1 parent cbe660b commit 2585a2f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

peerconnection.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@ type PeerConnection struct {
9797
//
9898
// If you wish to customize the set of available codecs and/or the set of active interceptors,
9999
// create an API with a custom MediaEngine and/or interceptor.Registry,
100-
// then call API.NewPeerConnection() instead of this function.
100+
// then call [(*API).NewPeerConnection] instead of this function.
101101
func NewPeerConnection(configuration Configuration) (*PeerConnection, error) {
102102
api := NewAPI()
103103
return api.NewPeerConnection(configuration)
104104
}
105105

106-
// NewPeerConnection creates a new PeerConnection with the provided configuration against the received API object
106+
// NewPeerConnection creates a new PeerConnection with the provided configuration against the received API object.
107+
// This method will attach a default set of codecs and interceptors to
108+
// the resulting PeerConnection. If this behavior is not desired,
109+
// set the set of codecs and interceptors explicitly by using
110+
// [WithMediaEngine] and [WithInterceptorRegistry] when calling [NewAPI].
107111
func (api *API) NewPeerConnection(configuration Configuration) (*PeerConnection, error) {
108112
// https://w3c.github.io/webrtc-pc/#constructor (Step #2)
109113
// Some variables defined explicitly despite their implicit zero values to

0 commit comments

Comments
 (0)