Summary

Functions

Returns a specification to start this module under a supervisor.

Closes the PlainTransport.

Tells whether the given PlainTransport is closed on the local node.

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

PlainTransport 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

Local SRTP parameters representing the crypto suite and key material used to encrypt sending RTP and SRTP. Note that, if comedia mode is set, these local SRTP parameters may change after calling connect() with the remote SRTP parameters (to override the local SRTP crypto suite with the one given in connect(). https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-srtpParameters

The transport tuple. If RTCP-mux is enabled (rtcpMux is set), this tuple refers to both RTP and RTCP. https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-tuple

Types

@type connect_option() :: map()
@type create_option() :: map() | Mediasoup.PlainTransport.Options.t()
@type event_type() :: :on_close | :on_tuple | :on_sctp_state_change
@type t() :: %Mediasoup.PlainTransport{id: String.t(), pid: pid()}
@type transport_stat() :: map()

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec close(t()) :: :ok

Closes the PlainTransport.

Link to this function

closed?(plain_transport)

View Source
@spec closed?(t()) :: boolean()

Tells whether the given PlainTransport is closed on the local node.

Link to this function

connect(plain_transport, option)

View Source
@spec connect(t(), connect_option()) :: {:ok} | {:error, String.t() | :terminated}

Provides the plain transport with the endpoint parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-connect

Link to this function

consume(transport, option)

View Source
@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

Link to this function

event(transport, listener, event_types \\ [:on_close, :on_tuple, :on_sctp_state_change])

View Source
@spec event(t(), pid(), event_types :: [event_type()]) ::
  {:ok} | {:error, :terminated}

Starts observing event.

Link to this function

get_stats(plain_transport)

View Source
@spec get_stats(t()) :: [transport_stat()] | {:error, :terminated}

Returns current RTC statistics of the WebRTC transport. https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-getStats

@spec id(t()) :: String.t()

PlainTransport identifier.

Link to this function

produce(transport, option)

View Source
@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

Link to this function

sctp_parameters(plain_transport)

View Source
@spec sctp_parameters(t()) :: map() | {:error, :terminated}

Local SCTP parameters. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-sctpParameters

Link to this function

sctp_state(plain_transport)

View Source
@spec sctp_state(t()) :: String.t() | {:error, :terminated}

Current SCTP state. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-sctpState

Link to this function

srtp_parameters(plain_transport)

View Source
@spec srtp_parameters(t()) :: map() | {:error, :terminated}

Local SRTP parameters representing the crypto suite and key material used to encrypt sending RTP and SRTP. Note that, if comedia mode is set, these local SRTP parameters may change after calling connect() with the remote SRTP parameters (to override the local SRTP crypto suite with the one given in connect(). https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-srtpParameters

@spec struct_from_pid(pid()) :: t()
Link to this function

struct_from_pid_and_ref(pid, reference)

View Source
@spec tuple(t()) :: TransportTuple.t() | {:error, :terminated}

The transport tuple. If RTCP-mux is enabled (rtcpMux is set), this tuple refers to both RTP and RTCP. https://mediasoup.org/documentation/v3/mediasoup/api/#plainTransport-tuple