Remove global API for settings engine

Limit global API to the basics needed to construct a PeerConnection.
This commit is contained in:
backkem
2019-02-21 19:24:24 +01:00
committed by Michiel De Backker
parent 585f50ef86
commit 4fe2728721
3 changed files with 24 additions and 36 deletions

24
api.go
View File

@@ -1,9 +1,5 @@
package webrtc
import (
"time"
)
// API bundles the global funcions of the WebRTC and ORTC API.
// Some of these functions are also exported globally using the
// defaultAPI object. Note that the global version of the API
@@ -53,26 +49,6 @@ func WithSettingEngine(s SettingEngine) func(a *API) {
// in the future.
var defaultAPI = NewAPI()
// Setting engine API
// SetEphemeralUDPPortRange on the default API.
// See SettingEngine for details.
func SetEphemeralUDPPortRange(portMin, portMax uint16) error {
return defaultAPI.settingEngine.SetEphemeralUDPPortRange(portMin, portMax)
}
// DetachDataChannels on the default API.
// See SettingEngine for details.
func DetachDataChannels() {
defaultAPI.settingEngine.DetachDataChannels()
}
// SetConnectionTimeout on the default API.
// See SettingEngine for details.
func SetConnectionTimeout(connectionTimeout, keepAlive time.Duration) {
defaultAPI.settingEngine.SetConnectionTimeout(connectionTimeout, keepAlive)
}
// Media Engine API
// RegisterCodec on the default API.