Skip to content

Commit

Permalink
Improve the documentation of NewPeerConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
jech committed Nov 6, 2024
1 parent 363e017 commit 3ee0ee6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions peerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,17 @@ type PeerConnection struct {
//
// If you wish to customize the set of available codecs and/or the set of active interceptors,
// create an API with a custom MediaEngine and/or interceptor.Registry,
// then call API.NewPeerConnection() instead of this function.
// then call [(*API).NewPeerConnection] instead of this function.
func NewPeerConnection(configuration Configuration) (*PeerConnection, error) {
api := NewAPI()
return api.NewPeerConnection(configuration)
}

// NewPeerConnection creates a new PeerConnection with the provided configuration against the received API object
// NewPeerConnection creates a new PeerConnection with the provided configuration against the received API object.
// This method will attach a default set of codecs and interceptors to
// the resulting PeerConnection. If this behaviour is not desired,

Check failure on line 108 in peerconnection.go

View workflow job for this annotation

GitHub Actions / lint / Go

`behaviour` is a misspelling of `behavior` (misspell)
// set the set of codecs and interceptors explicitly by using
// [WithMediaEngine] and [WithInterceptorRegistry] when calling [NewAPI].
func (api *API) NewPeerConnection(configuration Configuration) (*PeerConnection, error) {
// https://w3c.github.io/webrtc-pc/#constructor (Step #2)
// Some variables defined explicitly despite their implicit zero values to
Expand Down

0 comments on commit 3ee0ee6

Please sign in to comment.