diff --git a/datachannel_js.go b/datachannel_js.go index d96c2dd6..add07b69 100644 --- a/datachannel_js.go +++ b/datachannel_js.go @@ -36,6 +36,11 @@ type DataChannel struct { api *API } +// JSValue returns the underlying RTCDataChannel +func (d *DataChannel) JSValue() js.Value { + return d.underlying +} + // OnOpen sets an event handler which is invoked when // the underlying data transport has been established (or re-established). func (d *DataChannel) OnOpen(f func()) { diff --git a/dtlstransport_js.go b/dtlstransport_js.go index bc3444e5..846cfb71 100644 --- a/dtlstransport_js.go +++ b/dtlstransport_js.go @@ -17,6 +17,11 @@ type DTLSTransport struct { underlying js.Value } +// JSValue returns the underlying RTCDtlsTransport +func (r *DTLSTransport) JSValue() js.Value { + return r.underlying +} + // ICETransport returns the currently-configured *ICETransport or nil // if one has not been configured func (r *DTLSTransport) ICETransport() *ICETransport { diff --git a/icetransport_js.go b/icetransport_js.go index 3ca577b1..29c69ad7 100644 --- a/icetransport_js.go +++ b/icetransport_js.go @@ -15,6 +15,11 @@ type ICETransport struct { underlying js.Value } +// JSValue returns the underlying RTCIceTransport +func (t *ICETransport) JSValue() js.Value { + return t.underlying +} + // GetSelectedCandidatePair returns the selected candidate pair on which packets are sent // if there is no selected pair nil is returned func (t *ICETransport) GetSelectedCandidatePair() (*ICECandidatePair, error) { diff --git a/rtpreceiver_js.go b/rtpreceiver_js.go index 44cef72d..af82a6cb 100644 --- a/rtpreceiver_js.go +++ b/rtpreceiver_js.go @@ -13,3 +13,8 @@ type RTPReceiver struct { // Pointer to the underlying JavaScript RTCRTPReceiver object. underlying js.Value } + +// JSValue returns the underlying RTCRtpReceiver +func (r *RTPReceiver) JSValue() js.Value { + return r.underlying +} \ No newline at end of file diff --git a/rtpsender_js.go b/rtpsender_js.go index 46ea599f..42a57432 100644 --- a/rtpsender_js.go +++ b/rtpsender_js.go @@ -13,3 +13,8 @@ type RTPSender struct { // Pointer to the underlying JavaScript RTCRTPSender object. underlying js.Value } + +// JSValue returns the underlying RTCRtpSender +func (s *RTPSender) JSValue() js.Value { + return s.underlying +} diff --git a/rtptransceiver_js.go b/rtptransceiver_js.go index 43e129af..14ff92a7 100644 --- a/rtptransceiver_js.go +++ b/rtptransceiver_js.go @@ -16,6 +16,11 @@ type RTPTransceiver struct { underlying js.Value } +// JSValue returns the underlying RTCRtpTransceiver +func (r *RTPTransceiver) JSValue() js.Value { + return r.underlying +} + // Direction returns the RTPTransceiver's current direction func (r *RTPTransceiver) Direction() RTPTransceiverDirection { return NewRTPTransceiverDirection(r.underlying.Get("direction").String()) diff --git a/sctptransport_js.go b/sctptransport_js.go index 7ab6c390..701b7f73 100644 --- a/sctptransport_js.go +++ b/sctptransport_js.go @@ -14,6 +14,11 @@ type SCTPTransport struct { underlying js.Value } +// JSValue returns the underlying RTCSctpTransport +func (r *SCTPTransport) JSValue() js.Value { + return r.underlying +} + // Transport returns the DTLSTransport instance the SCTPTransport is sending over. func (r *SCTPTransport) Transport() *DTLSTransport { underlying := r.underlying.Get("transport")