From 3ee0ee6964b861164ea24d4c4810d8142d5f895a Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 6 Nov 2024 18:44:32 +0100 Subject: [PATCH] Improve the documentation of NewPeerConnection --- peerconnection.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/peerconnection.go b/peerconnection.go index 4b2a16e39ca..e14e1ca071e 100644 --- a/peerconnection.go +++ b/peerconnection.go @@ -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, +// 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