Summary

Functions

Returns a specification to start this module under a supervisor.

Closes the producer. Triggers a “producerclose” event in all its associated consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-close

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

Dump internal stat for Producer.

Returns current RTC statistics of the producer. Check the RTC Statistics section for more details (TypeScript-oriented, but concepts apply here as well).

Producer identifier.

The media kind

Pauses the producer (no RTP is sent to its associated consumers). Triggers a “producerpause” event in all its associated consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-pause

Resumes the producer (RTP is sent again to its associated consumers). Triggers a “producerresume” event in all its associated consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-resume

The score of each RTP stream being received, representing their tranmission quality. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-score

Types

@type event_type() ::
  :on_close | :on_pause | :on_resume | :on_video_orientation_change | :on_score
@type mediaKind() :: String.t()

audio or video

@type producerType() :: String.t()

https://mediasoup.org/documentation/v3/mediasoup/api/#ProducerType “simple” or “simulcast” or “svc”

@type rtpParameters() :: map()
@type t() :: %Mediasoup.Producer{
  id: String.t(),
  kind: mediaKind(),
  pid: pid(),
  rtp_parameters: rtpParameters(),
  type: producerType()
}

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

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

Closes the producer. Triggers a “producerclose” event in all its associated consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-close

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

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

@spec dump(t()) :: map()

Dump internal stat for Producer.

Link to this function

event(producer, listener, event_types \\ [:on_close, :on_pause, :on_resume, :on_video_orientation_change, :on_score])

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

Starts observing event.

@spec get_stats(t()) :: list() | {:error, reason :: term()}

Returns current RTC statistics of the producer. Check the RTC Statistics section for more details (TypeScript-oriented, but concepts apply here as well).

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

Producer identifier.

@spec kind(t()) :: mediaKind()

The media kind

@spec pause(t()) :: {:ok} | {:error}

Pauses the producer (no RTP is sent to its associated consumers). Triggers a “producerpause” event in all its associated consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-pause

@spec paused?(t()) :: boolean() | {:error}

Whether the producer is paused. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-paused

@spec resume(t()) :: {:ok} | {:error}

Resumes the producer (RTP is sent again to its associated consumers). Triggers a “producerresume” event in all its associated consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-resume

@spec rtp_parameters(t()) :: rtpParameters()

RtpParameters. https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpParameters

@spec score(t()) :: list() | {:error}

The score of each RTP stream being received, representing their tranmission quality. https://mediasoup.org/documentation/v3/mediasoup/api/#producer-score

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

struct_from_pid_and_ref(pid, reference)

View Source
@spec type(t()) :: producerType()

Producer type. https://mediasoup.org/documentation/v3/mediasoup/api/#ProducerType