View Source Mediasoup.WebRtcTransport (mediasoup_elixir v0.14.4)
https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransport
Summary
Functions
Returns a specification to start this module under a supervisor.
Closes the WebRtcTransport.
Tells whether the given WebRtcTransport is closed on the local node.
Provides the WebRTC transport with the endpoint parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-connect
Instructs the router to send audio or video RTP (or SRTP depending on the transport class). This is the way to extract media from mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consume
Instructs the router to send data messages to the endpoint via SCTP protocol or directly to the Node.js process if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consumedata
Local DTLS parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-dtlsParameters
Current DTLS state. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-dtlsState
Dump internal stat for WebRtcTransport.
Starts observing event.
Returns current RTC statistics of the WebRTC transport. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-getStats
Local ICE candidates. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceCandidates
Local ICE parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceParameters
Local ICE role. Due to the mediasoup ICE Lite design, this is always “controlled”. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceRole
The selected transport tuple if ICE is in “connected” or “completed” state. It is undefined if ICE is not established (no working candidate pair was found). https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceSelectedTuple
WebRtcTransport identifier.
Instructs the router to receive audio or video RTP (or SRTP depending on the transport class). This is the way to inject media into mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-produce
Instructs the router to receive data messages. Those messages can be delivered by an endpoint via SCTP protocol or can be directly sent from the Node.js application if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-producedata
Local SCTP parameters. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-sctpParameters
Current SCTP state. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-sctpState
Types
@type connect_option() :: map()
@type create_option() :: map() | Mediasoup.WebRtcTransport.Options.t()
@type event_type() ::
:on_close
| :on_sctp_state_change
| :on_ice_state_change
| :on_dtls_state_change
| :on_ice_selected_tuple_change
@type ice_parameter() :: map()
@type transport_stat() :: map()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec close(t()) :: :ok
Closes the WebRtcTransport.
Tells whether the given WebRtcTransport is closed on the local node.
@spec connect(t(), connect_option()) :: {:ok} | {:error, String.t() | :terminated}
Provides the WebRTC transport with the endpoint parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-connect
@spec consume(t(), Mediasoup.Consumer.Options.t() | map()) :: {:ok, Mediasoup.Consumer.t()} | {:error, String.t() | :terminated}
Instructs the router to send audio or video RTP (or SRTP depending on the transport class). This is the way to extract media from mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consume
@spec consume_data(t(), Mediasoup.DataConsumer.Options.t() | map()) :: {:ok, Mediasoup.DataConsumer.t()} | {:error, String.t() | :terminated}
Instructs the router to send data messages to the endpoint via SCTP protocol or directly to the Node.js process if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consumedata
Local DTLS parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-dtlsParameters
Current DTLS state. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-dtlsState
Dump internal stat for WebRtcTransport.
event(transport, listener, event_types \\ [:on_close, :on_sctp_state_change, :on_ice_state_change, :on_dtls_state_change, :on_ice_selected_tuple_change])
View Source@spec event(t(), pid(), event_types :: [event_type()]) :: {:ok} | {:error, :terminated}
Starts observing event.
@spec get_stats(t()) :: [transport_stat()] | {:error, reason :: term()}
Returns current RTC statistics of the WebRTC transport. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-getStats
Local ICE candidates. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceCandidates
@spec ice_parameters(t()) :: ice_parameter() | {:error, :terminated}
Local ICE parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceParameters
Local ICE role. Due to the mediasoup ICE Lite design, this is always “controlled”. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceRole
The selected transport tuple if ICE is in “connected” or “completed” state. It is undefined if ICE is not established (no working candidate pair was found). https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceSelectedTuple
Current ICE state. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceState
WebRtcTransport identifier.
@spec produce(t(), Mediasoup.Producer.Options.t() | map()) :: {:ok, Mediasoup.Producer.t()} | {:error, String.t() | :terminated}
Instructs the router to receive audio or video RTP (or SRTP depending on the transport class). This is the way to inject media into mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-produce
@spec produce_data(t(), Mediasoup.DataProducer.Options.t() | map()) :: {:ok, Mediasoup.DataProducer.t()} | {:error, String.t() | :terminated}
Instructs the router to receive data messages. Those messages can be delivered by an endpoint via SCTP protocol or can be directly sent from the Node.js application if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-producedata
@spec restart_ice(t()) :: {:ok, ice_parameter()} | {:error, :terminated}
Current ICE state. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-iceState
Local SCTP parameters. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-sctpParameters
Current SCTP state. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#webRtcTransport-sctpState