Files
webrtc/sctptransport_js.go
Sean DuBois 94262c1b2b Add DTLS, ICE and SCTP Transport to WASM
Only available in the browser, not in wrtc yet.

Resolves #2099
2022-02-08 00:37:47 -05:00

25 lines
560 B
Go

//go:build js && wasm
// +build js,wasm
package webrtc
import "syscall/js"
// SCTPTransport provides details about the SCTP transport.
type SCTPTransport struct {
// Pointer to the underlying JavaScript SCTPTransport object.
underlying js.Value
}
// Transport returns the DTLSTransport instance the SCTPTransport is sending over.
func (r *SCTPTransport) Transport() *DTLSTransport {
underlying := r.underlying.Get("transport")
if underlying.IsNull() || underlying.IsUndefined() {
return nil
}
return &DTLSTransport{
underlying: underlying,
}
}