View Source Mediasoup.Consumer (mediasoup_elixir v0.14.4)
https://mediasoup.org/documentation/v3/mediasoup/api/#Consumer
Summary
Functions
Returns a specification to start this module under a supervisor.
Closes the consumer.
Tells whether the given consumer is closed on the local node.
Currently active spatial and temporal layers (for simulcast and SVC consumers only). It's nil if no layers are being sent to the consuming endpoint at this time (or if the consumer is consuming from a simulcast or svc producer). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-currentLayers
Dump internal stat for Consumer.
Starts observing event.
Returns current RTC statistics of the consumer. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-getStats
Consumer identifier.
The media kind
Pauses the consumer (no RTP is sent to the consuming endpoint). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-pause
Whether the consumer is paused. It does not take into account whether the associated producer is paused. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-paused
Preferred spatial and temporal layers (see set_preferred_layers/2 method). For simulcast and SVC consumers, nil otherwise. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-preferredLayers
Consumer priority (see set_priority/2). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-priority
The associated producer identifier.
Whether the associated producer is paused. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-producerPaused
Request a key frame to the associated producer. Just valid for video consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-requestKeyFrame
Resumes the consumer (RTP is sent again to the consuming endpoint). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-resume
Consumer RTP parameters.
The score of the RTP stream being sent, representing its tranmission quality.
Sets the preferred (highest) spatial and temporal layers to be sent to the consuming endpoint. Just valid for simulcast and SVC consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-setPreferredLayers
Sets the priority for this consumer. It affects how the estimated outgoing bitrate in the transport (obtained via transport-cc or REMB) is distributed among all video consumers, by priorizing those with higher priority. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-setPriority
Unsets the priority for this consumer (it sets it to its default value 1). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-unsetPriority
Types
@type consumer_layers() :: map()
https://mediasoup.org/documentation/v3/mediasoup/api/#ConsumerLayers
@type consumer_score() :: map()
https://mediasoup.org/documentation/v3/mediasoup/api/#ConsumerScore
@type event_type() ::
:on_close
| :on_pause
| :on_resume
| :on_producer_resume
| :on_producer_pause
| :on_producer_close
| :on_transport_close
| :on_score
| :on_layers_change
@type kind() :: String.t()
MediaKind("audio" or "video")
@type rtpParameters() :: map()
@type type() :: String.t()
https://mediasoup.org/documentation/v3/mediasoup/api/#ConsumerType
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec close(t()) :: :ok
Closes the consumer.
Tells whether the given consumer is closed on the local node.
@spec current_layers(t()) :: consumer_layers() | nil
Currently active spatial and temporal layers (for simulcast and SVC consumers only). It's nil if no layers are being sent to the consuming endpoint at this time (or if the consumer is consuming from a simulcast or svc producer). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-currentLayers
Dump internal stat for Consumer.
event(consumer, listener, event_types \\ [:on_close, :on_pause, :on_resume, :on_producer_resume, :on_producer_pause, :on_producer_close, :on_transport_close, :on_score, :on_layers_change])
View Source@spec event(t(), pid(), event_types :: [event_type()]) :: {:ok} | {:error, :terminated}
Starts observing event.
Returns current RTC statistics of the consumer. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-getStats
Consumer identifier.
The media kind
@spec pause(t()) :: {:ok} | {:error}
Pauses the consumer (no RTP is sent to the consuming endpoint). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-pause
Whether the consumer is paused. It does not take into account whether the associated producer is paused. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-paused
@spec preferred_layers(t()) :: consumer_layers() | nil
Preferred spatial and temporal layers (see set_preferred_layers/2 method). For simulcast and SVC consumers, nil otherwise. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-preferredLayers
Consumer priority (see set_priority/2). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-priority
The associated producer identifier.
Whether the associated producer is paused. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-producerPaused
@spec request_key_frame(t()) :: {:ok} | {:error}
Request a key frame to the associated producer. Just valid for video consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-requestKeyFrame
@spec resume(t()) :: {:ok} | {:error}
Resumes the consumer (RTP is sent again to the consuming endpoint). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-resume
@spec rtp_parameters(t()) :: rtpParameters()
Consumer RTP parameters.
@spec score(t()) :: consumer_score()
The score of the RTP stream being sent, representing its tranmission quality.
Sets the preferred (highest) spatial and temporal layers to be sent to the consuming endpoint. Just valid for simulcast and SVC consumers. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-setPreferredLayers
Sets the priority for this consumer. It affects how the estimated outgoing bitrate in the transport (obtained via transport-cc or REMB) is distributed among all video consumers, by priorizing those with higher priority. https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-setPriority
Consumer type. https://mediasoup.org/documentation/v3/mediasoup/api/#ConsumerType
@spec unset_priority(t()) :: {:ok} | {:error}
Unsets the priority for this consumer (it sets it to its default value 1). https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-unsetPriority