-
I need type PeerConnection struct {
//...
api *API
//...
} type API struct {
settingEngine *SettingEngine
//...
} type SettingEngine struct {
//...
answeringDTLSRole DTLSRole
//...
} I have found no such exported way to set such option, wondering how to get this work //No option for DTSL role
func NewPeerConnection(configuration Configuration) (*PeerConnection, error) {
m := &MediaEngine{}
if err := m.RegisterDefaultCodecs(); err != nil {
return nil, err
}
i := &interceptor.Registry{}
if err := RegisterDefaultInterceptors(m, i); err != nil {
return nil, err
}
api := NewAPI(WithMediaEngine(m), WithInterceptorRegistry(i))
return api.NewPeerConnection(configuration)
} |
Beta Was this translation helpful? Give feedback.
Answered by
http600
Aug 26, 2021
Replies: 1 comment
-
alright, we can do this m := &webrtc.MediaEngine{}
if err := m.RegisterDefaultCodecs(); err != nil {
panic(err)
}
i := &interceptor.Registry{}
if err := webrtc.RegisterDefaultInterceptors(m, i); err != nil {
panic(err)
}
engine := webrtc.SettingEngine{}
err := engine.SetAnsweringDTLSRole(webrtc.DTLSRoleServer)
if err != nil {
panic(err)
}
api := webrtc.NewAPI(webrtc.WithMediaEngine(m), webrtc.WithInterceptorRegistry(i), webrtc.WithSettingEngine(engine)) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Sean-Der
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alright, we can do this