Constructor
- Source:
Fires:
Extends
Members
(static) constructorParams
- Source:
(static) events
- Source:
Methods
(static) connect(sink, mediaTypeopt, sourceMediaDescriptionopt, sinkMediaDescriptionopt, callbackopt) → {external:Promise}
Connects two elements, with the media flowing from left to right.
The element that invokes the connect will be the source of media, creating
one
sink pad for each type of media connected. The element given as parameter
to
the method will be the sink, and it will create one sink pad per media type
connected.
If otherwise not specified, all types of media are connected by default
(AUDIO, VIDEO and DATA). It is recommended to connect the specific types of
media if not all of them will be used. For this purpose, the connect method
can be invoked more than once on the same two elements, but with different
media types.
The connection is unidirectional. If a bidirectional connection is desired,
the position of the media elements must be inverted. For instance,
webrtc1.connect(webrtc2) is connecting webrtc1 as source of webrtc2. In
order
to create a WebRTC one-2one conversation, the user would need to specify
the
connection on the other direction with webrtc2.connect(webrtc1).
Even though one media element can have one sink pad per type of media, only
one media element can be connected to another at a given time. If a media
element is connected to another, the former will become the source of the
sink
media element, regardless whether there was another element connected or
not.
Parameters:
Name |
Type |
Attributes |
Description |
sink |
module:core/abstracts.MediaElement
|
|
the target MediaElement that will receive media |
mediaType |
module:core/complexTypes.MediaType
|
<optional>
|
the MediaType of the pads that will be connected |
sourceMediaDescription |
external:String
|
<optional>
|
A textual description of the media source. Currently not used, aimed mainly
for core/abstracts.MediaElementMediaType#DATA sources |
sinkMediaDescription |
external:String
|
<optional>
|
A textual description of the media source. Currently not used, aimed mainly
for core/abstracts.MediaElementMediaType#DATA sources |
callback |
module:core/abstracts.MediaElement~connectCallback
|
<optional>
|
|
- Source:
Returns:
-
Type
-
external:Promise
(static) disconnect(sink, mediaTypeopt, sourceMediaDescriptionopt, sinkMediaDescriptionopt, callbackopt) → {external:Promise}
Disconnects two media elements. This will release the source pads of the
source media element, and the sink pads of the sink media element.
Parameters:
Name |
Type |
Attributes |
Description |
sink |
module:core/abstracts.MediaElement
|
|
the target MediaElement that will stop receiving media |
mediaType |
module:core/complexTypes.MediaType
|
<optional>
|
the MediaType of the pads that will be connected |
sourceMediaDescription |
external:String
|
<optional>
|
A textual description of the media source. Currently not used, aimed mainly
for core/abstracts.MediaElementMediaType#DATA sources |
sinkMediaDescription |
external:String
|
<optional>
|
A textual description of the media source. Currently not used, aimed mainly
for core/abstracts.MediaElementMediaType#DATA sources |
callback |
module:core/abstracts.MediaElement~disconnectCallback
|
<optional>
|
|
- Source:
Returns:
-
Type
-
external:Promise
(static) getGstreamerDot(detailsopt, callbackopt) → {external:Promise}
Return a .dot file describing the topology of the media element.
The element can be queried for certain type of data:
- SHOW_ALL: default value
- SHOW_CAPS_DETAILS
- SHOW_FULL_PARAMS
- SHOW_MEDIA_TYPE
- SHOW_NON_DEFAULT_PARAMS
- SHOW_STATES
- SHOW_VERBOSE
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
(static) getSinkConnections(mediaTypeopt, descriptionopt, callbackopt) → {external:Promise}
Gets information about the source pads of this media element.
Since source pads connect to other media element's sinks, this is formally
the
sink of media from the element's perspective. Media can be filtered by
type,
or by the description given to the pad though which both elements are
connected.
Parameters:
Name |
Type |
Attributes |
Description |
mediaType |
module:core/complexTypes.MediaType
|
<optional>
|
One of core/abstracts.MediaElementMediaType#AUDIO, core/abstracts.MediaElementMediaType#VIDEO or core/abstracts.MediaElementMediaType#DATA |
description |
external:String
|
<optional>
|
A textual description of the media source. Currently not used, aimed mainly
for core/abstracts.MediaElementMediaType#DATA sources |
callback |
module:core/abstracts.MediaElement~getSinkConnectionsCallback
|
<optional>
|
|
- Source:
Returns:
-
Type
-
external:Promise
(static) getSourceConnections(mediaTypeopt, descriptionopt, callbackopt) → {external:Promise}
Gets information about the sink pads of this media element.
Since sink pads are the interface through which a media element gets it's
media, whatever is connected to an element's sink pad is formally a source
of
media. Media can be filtered by type, or by the description given to the
pad
though which both elements are connected.
Parameters:
Name |
Type |
Attributes |
Description |
mediaType |
module:core/complexTypes.MediaType
|
<optional>
|
One of core/abstracts.MediaElementMediaType#AUDIO, core/abstracts.MediaElementMediaType#VIDEO or core/abstracts.MediaElementMediaType#DATA |
description |
external:String
|
<optional>
|
A textual description of the media source. Currently not used, aimed mainly
for core/abstracts.MediaElementMediaType#DATA sources |
callback |
module:core/abstracts.MediaElement~getSourceConnectionsCallback
|
<optional>
|
|
- Source:
Returns:
-
Type
-
external:Promise
(static) getStats(mediaTypeopt, callbackopt) → {external:Promise}
Gets the statistics related to an endpoint. If no media type is specified, it
Parameters:
Name |
Type |
Attributes |
Description |
mediaType |
module:core/complexTypes.MediaType
|
<optional>
|
One of core/abstracts.MediaElementMediaType#AUDIO or core/abstracts.MediaElementMediaType#VIDEO |
callback |
module:core/abstracts.MediaElement~getStatsCallback
|
<optional>
|
|
- Source:
Returns:
-
Type
-
external:Promise
This method indicates whether the media element is receiving media of a
certain type. The media sink pad can be identified individually, if needed.
It is only supported for AUDIO and VIDEO types, raising a
MEDIA_OBJECT_ILLEGAL_PARAM_ERROR otherwise. If the pad indicated does not
exist, if will return false.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
This method indicates whether the media element is emitting media of a
certain type. The media source pad can be identified individually, if needed.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
Indicates whether this media element is actively transcoding between input
and output pads. This operation is only supported for AUDIO and VIDEO media
types, raising a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR otherwise.
The internal GStreamer processing bin can be indicated, if needed;
if the bin doesn't exist, the return value will be FALSE.
Parameters:
Name |
Type |
Attributes |
Description |
mediaType |
module:core/complexTypes.MediaType
|
|
One of core/abstracts.MediaElementMediaType#AUDIO or core/abstracts.MediaElementMediaType#VIDEO |
binName |
external:String
|
<optional>
|
Internal name of the processing bin, as previously given by
MediaTranscodingStateChanged . |
callback |
module:core/abstracts.MediaElement~isMediaTranscodingCallback
|
<optional>
|
|
- Source:
Returns:
-
Type
-
external:Promise
Set the type of data for the audio stream.
MediaElements that do not support configuration of audio capabilities will
throw a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR exception.
NOTE: This method is not implemented yet by the Media Server to do anything
useful.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
Set the type of data for the video stream.
MediaElements that do not support configuration of video capabilities will
throw a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR exception
NOTE: This method is not implemented yet by the Media Server to do anything
useful.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
Children of this MediaObject
.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
getCreationTime(callbackopt) → {external:Promise}
MediaObject
creation time in seconds since Epoch.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
getEncoderBitrate(callbackopt) → {external:Promise}
Target video bitrate for media transcoding.
The bitrate of a video has a direct impact on its perceived image quality.
Higher bitrate means higher quality, but also a larger amount of bytes to
transmit or store. Use this parameter to set the desired average bitrate in
videos that are transcoded by the media server.
This parameter is most useful for :rom:cls:`RecorderEndpoint` and
:rom:cls:`RtpEndpoint`: when media is being transcoded (either for
streaming
or storing on disk), the resulting quality is directly controlled with this
value.
For :rom:cls:`WebRtcEndpoint`, this value should be left as default, as
remote
WebRTC receivers will already send feedback to inform the media server
about
what is the optimal bitrate to send.
Setting a value will only work if done before the media starts to flow.
- Unit: bps (bits per second).
- Default: 300000 (300 kbps).
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
getMaxEncoderBitrate(callbackopt) → {external:Promise}
Maximum video bitrate for media transcoding.
This parameter can be used to fine tune the automatic bitrate selection
that
normally takes place within elements that are able to dynamically change
the
encoding bitrate according to the conditions of the streaming, such as
:rom:cls:`WebRtcEndpoint`.
This should be left as default in most cases, given that remote WebRTC
receivers already send feedback to inform the media server about what is
the
optimal bitrate to send. Otherwise, this parameter could be used for
example
to limit the total bitrate that is handled by the server, by setting a low
maximum output for all endpoints.
This should be left as default in most cases, given that remote WebRTC
receivers already send feedback to inform the media server about what is
the
optimal bitrate to send. Otherwise, this parameter could be used for
example
to limit the total bitrate that is handled by the server, by setting a low
maximum output for all endpoints.
Setting a value will only work if done before the media starts to flow.
- Unit: bps (bits per second).
- Default: 0.
-
0 = unlimited. Encoding performed with bitrate as requested by receivers.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
MediaPipeline to which this
MediaObject
belongs. It
returns itself when invoked for a pipeline object.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
getMinEncoderBitrate(callbackopt) → {external:Promise}
Minimum video bitrate for media transcoding.
This parameter can be used to fine tune the automatic bitrate selection
that
normally takes place within elements that are able to dynamically change
the
encoding bitrate according to the conditions of the streaming, such as
:rom:cls:`WebRtcEndpoint`.
This should be left as default in most cases, given that remote WebRTC
receivers already send feedback to inform the media server about what is
the
optimal bitrate to send. Otherwise, this parameter could be used for
example
to force a higher bitrate than what is being requested by receivers.
Setting a value will only work if done before the media starts to flow.
- Unit: bps (bits per second).
- Default: 0.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
This
MediaObject
's name.
This is just sugar to simplify developers' life debugging, it is not used
internally for indexing nor identifying the objects. By default, it's the
object's ID.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
Parent of this
MediaObject
.
The parent of a Hub or a MediaElement is its
MediaPipeline. A MediaPipeline has no parent, so this
property will be null.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
Flag activating or deactivating sending the element's tags in fired events.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
setEncoderBitrate(encoderBitrate, callbackopt) → {external:Promise}
Target video bitrate for media transcoding.
The bitrate of a video has a direct impact on its perceived image quality.
Higher bitrate means higher quality, but also a larger amount of bytes to
transmit or store. Use this parameter to set the desired average bitrate in
videos that are transcoded by the media server.
This parameter is most useful for :rom:cls:`RecorderEndpoint` and
:rom:cls:`RtpEndpoint`: when media is being transcoded (either for
streaming
or storing on disk), the resulting quality is directly controlled with this
value.
For :rom:cls:`WebRtcEndpoint`, this value should be left as default, as
remote
WebRTC receivers will already send feedback to inform the media server
about
what is the optimal bitrate to send.
Setting a value will only work if done before the media starts to flow.
- Unit: bps (bits per second).
- Default: 300000 (300 kbps).
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
setMaxEncoderBitrate(maxEncoderBitrate, callbackopt) → {external:Promise}
Maximum video bitrate for media transcoding.
This parameter can be used to fine tune the automatic bitrate selection
that
normally takes place within elements that are able to dynamically change
the
encoding bitrate according to the conditions of the streaming, such as
:rom:cls:`WebRtcEndpoint`.
This should be left as default in most cases, given that remote WebRTC
receivers already send feedback to inform the media server about what is
the
optimal bitrate to send. Otherwise, this parameter could be used for
example
to limit the total bitrate that is handled by the server, by setting a low
maximum output for all endpoints.
This should be left as default in most cases, given that remote WebRTC
receivers already send feedback to inform the media server about what is
the
optimal bitrate to send. Otherwise, this parameter could be used for
example
to limit the total bitrate that is handled by the server, by setting a low
maximum output for all endpoints.
Setting a value will only work if done before the media starts to flow.
- Unit: bps (bits per second).
- Default: 0.
-
0 = unlimited. Encoding performed with bitrate as requested by receivers.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
setMinEncoderBitrate(minEncoderBitrate, callbackopt) → {external:Promise}
Minimum video bitrate for media transcoding.
This parameter can be used to fine tune the automatic bitrate selection
that
normally takes place within elements that are able to dynamically change
the
encoding bitrate according to the conditions of the streaming, such as
:rom:cls:`WebRtcEndpoint`.
This should be left as default in most cases, given that remote WebRTC
receivers already send feedback to inform the media server about what is
the
optimal bitrate to send. Otherwise, this parameter could be used for
example
to force a higher bitrate than what is being requested by receivers.
Setting a value will only work if done before the media starts to flow.
- Unit: bps (bits per second).
- Default: 0.
Parameters:
- Source:
Returns:
-
Type
-
external:Promise
This
MediaObject
's name.
This is just sugar to simplify developers' life debugging, it is not used
internally for indexing nor identifying the objects. By default, it's the
object's ID.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
Flag activating or deactivating sending the element's tags in fired events.
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
external:Promise
Type Definitions
connectCallback(error)
Parameters:
- Source:
disconnectCallback(error)
Parameters:
- Source:
getEncoderBitrateCallback(error, result)
Parameters:
- Source:
getGstreamerDotCallback(error, result)
Parameters:
- Source:
getMaxEncoderBitrateCallback(error, result)
Parameters:
- Source:
getMinEncoderBitrateCallback(error, result)
Parameters:
- Source:
getSinkConnectionsCallback(error, result)
Parameters:
- Source:
getSourceConnectionsCallback(error, result)
Parameters:
- Source:
getStatsCallback(error, result)
Parameters:
Name |
Type |
Description |
error |
external:Error
|
|
result |
Object.<string, module:core/complexTypes.Stats>
|
Delivers a successful result in the form of a RTC stats report. A RTC stats
report represents a map between strings, identifying the inspected objects
(RTCStats.id), and their corresponding RTCStats objects. |
- Source:
Parameters:
- Source:
Parameters:
- Source:
Parameters:
- Source:
Parameters:
- Source:
setEncoderBitrateCallback(error)
Parameters:
- Source:
setMaxEncoderBitrateCallback(error)
Parameters:
- Source:
setMinEncoderBitrateCallback(error)
Parameters:
- Source:
Parameters:
- Source: