1// +build !js
2
3package webrtc
4
5import "github.com/pion/sdp/v2"
6
7// NewICETransport creates a new NewICETransport.
8// This constructor is part of the ORTC API. It is not
9// meant to be used together with the basic WebRTC API.
10func (api *API) NewICETransport(gatherer *ICEGatherer) *ICETransport {
11	return NewICETransport(gatherer, api.settingEngine.LoggerFactory)
12}
13
14func newICECandidateFromSDP(c sdp.ICECandidate) (ICECandidate, error) {
15	typ, err := NewICECandidateType(c.Typ)
16	if err != nil {
17		return ICECandidate{}, err
18	}
19	protocol, err := NewICEProtocol(c.Protocol)
20	if err != nil {
21		return ICECandidate{}, err
22	}
23	return ICECandidate{
24		Foundation:     c.Foundation,
25		Priority:       c.Priority,
26		Address:        c.Address,
27		Protocol:       protocol,
28		Port:           c.Port,
29		Component:      c.Component,
30		Typ:            typ,
31		RelatedAddress: c.RelatedAddress,
32		RelatedPort:    c.RelatedPort,
33	}, nil
34}
35