Browse Source

防止空指针错误

v4
langhuihui 4 years ago
parent
commit
68bda99c88
  1. 3
      main.go

3
main.go

@ -315,14 +315,13 @@ func run() {
rtc.s.SetEphemeralUDPPortRange(config.PortMin, config.PortMax)
}
rtc.api = NewAPI(WithMediaEngine(rtc.m), WithSettingEngine(rtc.s))
peerConnection, err := rtc.api.NewPeerConnection(Configuration{
rtc.PeerConnection, err = rtc.api.NewPeerConnection(Configuration{
// ICEServers: []ICEServer{
// {
// URLs: config.ICEServers,
// },
// },
})
rtc.PeerConnection = peerConnection
rtc.OnICECandidate(func(ice *ICECandidate) {
if ice != nil {
Println(ice.ToJSON().Candidate)

Loading…
Cancel
Save