settingengine_js.go 572 B

1234567891011121314151617181920
  1. //go:build js && wasm
  2. // +build js,wasm
  3. package webrtc
  4. // SettingEngine allows influencing behavior in ways that are not
  5. // supported by the WebRTC API. This allows us to support additional
  6. // use-cases without deviating from the WebRTC API elsewhere.
  7. type SettingEngine struct {
  8. detach struct {
  9. DataChannels bool
  10. }
  11. }
  12. // DetachDataChannels enables detaching data channels. When enabled
  13. // data channels have to be detached in the OnOpen callback using the
  14. // DataChannel.Detach method.
  15. func (e *SettingEngine) DetachDataChannels() {
  16. e.detach.DataChannels = true
  17. }