View Source Mediasoup.Producer (mediasoup_elixir v0.9.1)

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

Link to this section 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.

Callback implementation for GenServer.init/1.

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

Link to this section 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()
}

Link to this section 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}

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.

Callback implementation for GenServer.init/1.

@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