Simplify NewWebRTCDialer.

This commit is contained in:
David Fifield 2019-12-24 20:03:11 -07:00
parent 2fb52c8639
commit db1ba4791b

View file

@ -125,14 +125,9 @@ type WebRTCDialer struct {
} }
func NewWebRTCDialer(broker *BrokerChannel, iceServers []webrtc.ICEServer) *WebRTCDialer { func NewWebRTCDialer(broker *BrokerChannel, iceServers []webrtc.ICEServer) *WebRTCDialer {
var config webrtc.Configuration config := webrtc.Configuration{
if iceServers != nil {
config = webrtc.Configuration{
ICEServers: iceServers, ICEServers: iceServers,
} }
} else {
config = webrtc.Configuration{}
}
return &WebRTCDialer{ return &WebRTCDialer{
BrokerChannel: broker, BrokerChannel: broker,
webrtcConfig: &config, webrtcConfig: &config,