settingengine_js.go 674 B

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