Members
-
<constant> AudioCodec :string
-
Names of the supported audio codecs.
Type:
- string
Properties:
Name Type Default Description isacstring isac opusstring opus PCMAstring PCMA PCMUstring PCMU -
<constant> BandwidthProfileMode :string
-
BandwidthProfileMode specifies how RemoteVideoTracks' Track.Priority values are mapped to bandwidth allocation in Group Rooms.
Type:
- string
Properties:
Name Type Default Description gridstring grid This mode is for use cases where all the subscribed RemoteVideoTracks are equally important. The bandwidth allocation algorithm will share the available downlink bandwidth equally among the subscribed RemoteVideoTracks, irrespective of their Track.Priority. In case of insufficient downlink bandwidth, the lower priority RemoteVideoTracks are switched off.
collaborationstring collaboration This mode is for use cases where some RemoteVideoTracks are prioritized more than others. However, the lower priority RemoteVideoTracks still need to be visible. The bandwidth allocation algorithm will share the available downlink bandwidth proportional to the requested VideoRenderDimensions corresponding to their Track.Priority. In case of insufficient downlink bandwidth, the quality of higher priority RemoteVideoTracks may be degraded to avoid switching off lower priority RemoteVideoTracks.
presentationstring presentation This mode is for use cases where some RemoteVideoTracks are deemed critical and must be preserved at any cost over the other RemoteVideoTracks. The bandwidth allocation algorithm will allocate as big a share of the available downlink bandwidth as it possibly can to the higher priority RemoteVideoTracks, and only then consider the lower priority RemoteVideoTracks. In case of insufficient downlink bandwidth, the lower priority RemoteVideoTracks are switched off in order to preserve the quality of the higher priority RemoteVideoTracks.
-
<constant> ClientTrackSwitchOffControl :string
-
ClientTrackSwitchOffControl specifies how RemoteVideoTracks' turned on and off
Type:
- string
Properties:
Name Type Default Description autostring auto when set to auto, SDK uses the visibility of the video elements attached to the to the RemoteVideoTrack to decide. on turning tracks on or off. The track that are not attached to any video elements or not visible on the screen will be turned off automatically.
manualstring manual When set to manual, application can use RemoteVideoTracks switchOff and switchOn apis to control turn the track on or off.
-
<constant> EventListenerGroup :string
-
Names of the supported groups for EventListenerEvents.
Type:
- string
Properties:
Name Type Default Description signalingstring signaling Events associated with the connection to Twilio's signaling server
-
<constant> EventListenerLevel :string
-
Names of the supported levels for EventListenerEvents.
Type:
- string
Properties:
Name Type Default Description debugstring debug errorstring error infostring info warningstring warning -
<constant> LogLevel :string
-
Levels for logging verbosity.
Type:
- string
Properties:
Name Type Default Description debugstring debug infostring info warnstring warn errorstring error offstring off -
<constant> NetworkQualityVerbosity :number
-
The verbosity level of network quality information of a Participant.
Type:
- number
Properties:
Name Type Default Description nonenumber 0 Nothing is reported for the Participant. This has no effect and defaults to NetworkQualityVerbosity
#minimalfor the LocalParticipant.minimalnumber 1 Reports NetworkQualityLevel for the Participant.
moderatenumber 2 Reports NetworkQualityLevel and NetworkQualityStats for the Participant. NetworkQualityStats is populated with audio and video NetworkQualityLevels based on which the Participant's NetworkQualityLevel is calculated.
detailednumber 3 Reports NetworkQualityLevel and NetworkQualityStats for the Participant. NetworkQualityStats is populated with audio and Video NetworkQualityLevels and their corresponding NetworkQualityMediaStats based on which the Participant's NetworkQualityLevel is calculated.
-
<constant> PreflightProgress :string
-
progress values that are sent by PreflightTest#event:progress
Type:
- string
Properties:
Name Type Default Description mediaAcquiredstring mediaAcquired PreflightTest has successfully generated synthetic tracks
connectedstring connected PreflightTest has successfully connected to twilio server and obtained turn credentials
mediaSubscribedstring mediaSubscribed subscriberParticipant successfully subscribed to media tracks.
mediaStartedstring mediaStarted media flow was detected.
dtlsConnectedstring dtlsConnected established DTLS connection. This is measured from RTCDtlsTransport
connectingtoconnectedstate. On Safari, Support for measuring this is missing, this event will be not be emitted on Safari.peerConnectionConnectedstring peerConnectionConnected established a PeerConnection, This is measured from PeerConnection
connectingtoconnectedstate. On Firefox, Support for measuring this is missing, this event will be not be emitted on Firefox.iceConnectedstring iceConnected established ICE connection. This is measured from ICE connection
checkingtoconnectedstate. -
<constant> TrackSwitchOffMode :string
-
TrackSwitchOffMode specifies when RemoteVideoTracks' are switched off.
Type:
- string
Properties:
Name Type Default Description detectedstring detected In this mode, RemoteVideoTracks are switched off only when network congestion is detected.
predictedstring predicted In this mode, RemoteVideoTracks are pro-actively switched off when network congestion is predicted by the bandwidth estimation mechanism.
disabledstring disabled In this mode, RemoteVideoTracks are not switched off. Instead in response to network congestion, tracks will be adjusted to lower quality.
-
<constant> VideoCodec :string
-
Names of the supported video codecs.
Type:
- string
Properties:
Name Type Default Description H264string H264 VP8string VP8 -
<constant> VideoContentPreferencesMode :string
-
VideoContentPreferencesMode specifies how RemoteVideoTracks' render dimensions are decided by the SDK.
Type:
- string
Properties:
Name Type Default Description autostring auto when set to auto, SDK uses the sizes of the video elements attached to the to the RemoteVideoTrack dynamically to decide the render dimensions. RemoteVideoTracks rendered in smaller video elements will be given smaller bandwidth allocation compared to the tracks rendered in large video elements.
manualstring manual When set to manual, application can use RemoteVideoTrack#setContentPreference to set the desired render dimensions for the RemoteVideoTrack.
-
<constant> VideoEncodingMode :string
-
Names of the supported VideoEncodingMode.
Type:
- string
Properties:
Name Type Default Description Autostring auto
Type Definitions
-
AudioCodecSettings
-
Audio codec settings.
Type:
- object
Properties:
Name Type Description codecAudioCodec Audio codec name
-
AudioLevel
-
The maximum absolute amplitude of a set of audio samples in the range of 0 to 32767 inclusive.
Type:
- number
-
AudioTrackPublication
-
Type:
-
BandwidthProfileOptions
-
BandwidthProfileOptions allows you to configure how your available downlink bandwidth is shared among the RemoteTracks you have subscribed to in a Group Room.
Type:
- object
Properties:
Name Type Argument Description videoVideoBandwidthProfileOptions <optional>
Optional parameter to configure how your available downlink bandwidth is shared among the RemoteVideoTracks you have subscribed to in a Group Room.
-
ConnectOptions
-
You may pass these options to connect in order to override the default behavior.
Type:
- object
Properties:
Name Type Argument Default Description audioboolean | CreateLocalTrackOptions <optional>
true Whether or not to get local audio with
getUserMediawhentracksare not provided.automaticSubscriptionboolean <optional>
true By default, you will subscribe to all RemoteTracks shared by other Participants in a Room. You can now override this behavior by setting this flag to
false. It will make sure that you will not subscribe to any RemoteTrack in a Group or Small Group Room. Setting it totrue, or not setting it at all preserves the default behavior. This flag does not have any effect in a Peer-to-Peer Room.bandwidthProfileBandwidthProfileOptions <optional>
You can optionally configure how your available downlink bandwidth is shared among the RemoteTracks you have subscribed to in a Group Room. By default, bandwidth is shared equally among the RemoteTracks. This has no effect in Peer-to-Peer Rooms.
dominantSpeakerboolean <optional>
false Whether to enable the Dominant Speaker API or not. This only takes effect in Group Rooms.
dscpTaggingboolean <optional>
false (deprecated: use "enableDscp" instead)DSCP tagging allows you to request enhanced QoS treatment for RTP media packets from any firewall that the client may be behind. Setting this option totruewill request DSCP tagging for media packets on supported browsers (only Chrome supports this as of now). Audio packets will be sent with DSCP header value set to 0xb8 which corresponds to Expedited Forwarding (EF). Video packets will be sent with DSCP header value set to 0x88 which corresponds to Assured Forwarding (AF41).enableDscpboolean <optional>
false DSCP tagging allows you to request enhanced QoS treatment for RTP media packets from any firewall that the client may be behind. Setting this option to
truewill request DSCP tagging for media packets on supported browsers (only Chrome supports this as of now). Audio packets will be sent with DSCP header value set to 0xb8 which corresponds to Expedited Forwarding (EF). Video packets will be sent with DSCP header value set to 0x88 which corresponds to Assured Forwarding (AF41).eventListenerEventListener <optional>
(deprecated: use Video.Loggeryou can listen to fine-grained events related to signaling and media that are not available in the public APIs. These events might be useful for your own reporting and diagnostics.iceServersArray.<RTCIceServer> Override the STUN and TURN servers used when connecting to Rooms
iceTransportPolicyRTCIceTransportPolicy <optional>
"all" Override the ICE transport policy to be one of "relay" or "all"
insightsboolean <optional>
true Whether publishing events to the Insights gateway is enabled or not
maxAudioBitratenumber <optional>
<nullable>
null Max outgoing audio bitrate (bps); A
nullor a0value does not set any bitrate limit; This value is set as a hint for variable bitrate codecs, but will not take effect for fixed bitrate codecs; Based on our tests, Chrome, Firefox and Safari support a bitrate range of 12000 bps to 256000 bps for Opus codec; This parameter has no effect on iSAC, PCMU and PCMA codecsmaxVideoBitratenumber <optional>
<nullable>
null Max outgoing video bitrate (bps); A
nullor0value does not set any bitrate limit; This value is set as a hint for variable bitrate codecs, but will not take effect for fixed bitrate codecs; Based on our tests, Chrome, Firefox and Safari all seem to support an average bitrate range of 20000 bps (20 kbps) to 8000000 bps (8 mbps) for a 720p VideoTrack This parameter must not be set when when preferredVideoCodecs is set toauto.namestring <optional>
<nullable>
null Set to connect to a Room by name
networkQualityboolean | NetworkQualityConfiguration <optional>
false Whether to enable the Network Quality API or not. This only takes effect in Group Rooms. Pass a NetworkQualityConfiguration to configure verbosity levels for network quality information for LocalParticipant and RemoteParticipants. A
truevalue will set the NetworkQualityVerbosity for the LocalParticipant to NetworkQualityVerbosity#minimaland the NetworkQualityVerbosity for RemoteParticipants to NetworkQualityVerbosity#none.regionstring <optional>
'gll' Preferred signaling region; By default, you will be connected to the nearest signaling server determined by latency based routing. Setting a value other than
gllbypasses routing and guarantees that signaling traffic will be terminated in the region that you prefer. Please refer to this table for the list of supported signaling regions.preferredAudioCodecsArray.<(AudioCodec|AudioCodecSettings)> <optional>
[] Preferred audio codecs; An empty array preserves the current audio codec preference order.
preferredVideoCodecsArray.<(VideoCodec|VideoCodecSettings)> | VideoEncodingMode <optional>
[] Preferred video codecs; when set to 'VideoEncodingMode.Auto', SDK manages the video codec, by preferring VP8 simulcast in group rooms. It also enables adaptive simulcast, which allows SDK to turn off simulcast layers that are not needed for efficient bandwidth and CPU usage. An empty array preserves the current video codec. preference order. If you want to set a preferred video codec on a Group Room, you will need to create the Room using the REST API and set the
VideoCodecsproperty. See here for more information.logLevelLogLevel | LogLevels <optional>
'warn' (deprecated: use Video.Logger instead. See examples for details)Set the default log verbosity of logging. Passing a LogLevel string will use the same level for all components. Pass a LogLevels to set specific log levels.loggerNamestring <optional>
'twilio-video' The name of the logger. Use this name when accessing the logger used by the SDK. See examples for details.
tracksArray.<(LocalTrack|MediaStreamTrack)> <optional>
The LocalTracks or MediaStreamTracks with which to join the Room. These tracks can be obtained either by calling createLocalTracks, or by constructing them from the MediaStream obtained by calling
getUserMedia().videoboolean | CreateLocalTrackOptions <optional>
true Whether or not to get local video with
getUserMediawhentracksare not provided. -
CreateLocalTrackOptions
-
Create LocalTrack options. Apart from the properties listed here, you can also specify any of the MediaTrackConstraints properties.
Type:
- MediaTrackConstraints
Properties:
Name Type Argument Default Description logLevelLogLevel | LogLevels <optional>
'warn' (deprecated: use Video.Logger instead. See examples for details)Set the default log verbosity of logging. Passing a LogLevel string will use the same level for all components. Pass a LogLevels to set specific log levels.loggerNamestring <optional>
'twilio-video' The name of the logger. Use this name when accessing the logger used by the SDK. See examples for details.
namestring <optional>
The LocalTrack's name; by default, it is set to the LocalTrack's ID.
workaroundWebKitBug180748boolean <optional>
false Only valid for LocalAudioTracks; setting this attempts to workaround WebKit Bug 180748, where, in Safari, getUserMedia may return a silent audio MediaStreamTrack.
-
CreateLocalTracksOptions
-
createLocalTracks options
Type:
- object
Properties:
Name Type Argument Default Description audioboolean | CreateLocalTrackOptions <optional>
true Whether or not to get local audio with
getUserMediawhentracksare not provided.logLevelLogLevel | LogLevels <optional>
'warn' (deprecated: use Video.Logger instead. See examples for details)Set the default log verbosity of logging. Passing a LogLevel string will use the same level for all components. Pass a LogLevels to set specific log levels.loggerNamestring <optional>
'twilio-video' The name of the logger. Use this name when accessing the logger used by the SDK. See examples for details.
videoboolean | CreateLocalTrackOptions <optional>
true Whether or not to get local video with
getUserMediawhentracksare not provided. -
DataTrack
-
A DataTrack is a LocalDataTrack or RemoteDataTrack.
Type:
-
DataTrackPublication
-
Type:
-
EncodingParameters
-
Outgoing media encoding parameters.
Type:
- object
Properties:
Name Type Argument Description maxAudioBitratenumber <optional>
<nullable>
Max outgoing audio bitrate (bps); If not specified, retains the existing bitrate limit; A
nullor a0value removes any previously set bitrate limit; This value is set as a hint for variable bitrate codecs, but will not take effect for fixed bitrate codecs; Based on our tests, Chrome, Firefox and Safari support a bitrate range of 12000 bps to 256000 bps for Opus codec; This parameter has no effect on iSAC, PCMU and PCMA codecsmaxVideoBitratenumber <optional>
<nullable>
Max outgoing video bitrate (bps); If not specified, retains the existing bitrate limit; A
nullor a0value removes any previously set bitrate limit; This value is set as a hint for variable bitrate codecs, but will not take effect for fixed bitrate codecs; Based on our tests, Chrome, Firefox and Safari all seem to support an average bitrate range of 20000 bps (20 kbps) to 8000000 bps (8 mbps) for a 720p VideoTrack. Note: this limit is not applied for screen share tracks published on Chrome. -
EventListener
-
An EventListener allows you to listen to fine-grained EventListenerEvents related to signaling and media that are not available in the public APIs, which might be useful for your own reporting and diagnostics.
Type:
- EventEmitter
Example
const { EventEmitter } = require('events'); const { connect } = require('twilio-video'); const eventListener = new EventEmitter(); eventListener.on('event', function(event) { console.log('The SDK raised an event:', event); }); connect('token', { eventListener: eventListener }); -
EventListenerClosedEvent
-
The connection to Twilio's signaling server was closed.
Type:
Properties:
Name Type Default Description groupEventListenerGroup 'signaling' levelEventListenerLevel 'info' if the connection was closed by the client, 'error' otherwise
namestring 'closed' payloadObject Reason for the connection being closed. It can be one of 'busy', 'failed', 'local', 'remote' or 'timeout'
-
EventListenerConnectingEvent
-
The SDK is connecting to Twilio's signaling server.
Type:
Properties:
Name Type Default Description groupEventListenerGroup 'signaling' levelEventListenerLevel 'info' namestring 'connecting' -
EventListenerEarlyEvent
-
The SDK is about to connect to Twilio's signaling server.
Type:
Properties:
Name Type Default Description groupEventListenerGroup 'signaling' levelEventListenerLevel 'info' namestring 'early' -
EventListenerEvent
-
An EventListenerEvent provides context about an event raised by the SDK on the EventListener. Apart from the properties listed here, it may also include some event-specific data within an optional "payload" property. The different types of EventListenerEvents are listed below:
Type:
- object
Properties:
Name Type Argument Description elapsedTimenumber The time elapsed in milliseconds since connect() was called
groupEventListenerGroup The group under which the event is classified
levelEventListenerLevel The verbosity level of the event, which can be one of "debug", "error", "info", "warning"
namestring The name of the event
payload* <optional>
Optional event-specific data
timestampnumber The time in milliseconds relative to the Unix Epoch when the event was raised
-
EventListenerOpenEvent
-
The SDK has established a signaling connection to Twilio's signaling server.
Type:
Properties:
Name Type Default Description groupEventListenerGroup 'signaling' levelEventListenerLevel 'info' namestring 'open' -
EventListenerWaitingEvent
-
The SDK is waiting to retry connecting th Twilio's signaling server. This can happen if the server is busy with too many connection requests.
Type:
Properties:
Name Type Default Description groupEventListenerGroup 'signaling' levelEventListenerLevel 'warning' namestring 'waiting' -
LocalDataTrackOptions
-
LocalDataTrack options
Type:
Properties:
Name Type Argument Default Description maxPacketLifeTimenumber <optional>
<nullable>
null Set this to limit the time (in milliseconds) during which the LocalDataTrack will send or re-send data if not successfully delivered on the underlying RTCDataChannel(s). It is an error to specify both this and
maxRetransmits.maxRetransmitsnumber <optional>
<nullable>
null Set this to limit the number of times the LocalDataTrack will send or re-send data if not acknowledged on the underlying RTCDataChannel(s). It is an error to specify both this and
maxPacketLifeTime.orderedboolean <optional>
true Set this to false to allow data on the LocalDataTrack to be sent out-of-order.
-
LocalTrack
-
A LocalTrack is a LocalAudioTrack, LocalVideoTrack, or LocalDataTrack.
Type:
-
LocalTrackOptions
-
LocalTrack options
Type:
- object
Properties:
Name Type Argument Description logLevelLogLevel | LogLevels Log level for 'media' modules
namestring <optional>
The LocalTrack's name; by default, it is set to the LocalTrack's ID.
-
LocalTrackPublishOptions
-
Options for publishing a LocalTrack.
Type:
- object
Properties:
Name Type Argument Default Description priorityTrack.Priority <optional>
'standard' The priority with which the LocalTrack is to be published; In Group or Small Group Rooms, the appropriate bandwidth is allocated to the LocalTrack based on its Track.Priority; It has no effect in Peer-to-Peer Rooms; It defaults to "standard" when not provided
-
LogLevels
-
You may pass these levels to ConnectOptions to override log levels for individual components.
Type:
- object
Properties:
Name Type Argument Default Description defaultLogLevel <optional>
'warn' Log level for 'default' modules.
mediaLogLevel <optional>
'warn' Log level for 'media' modules.
signalingLogLevel <optional>
'warn' Log level for 'signaling' modules.
webrtcLogLevel <optional>
'warn' Log level for 'webrtc' modules.
-
MediaStreamTrackPublishOptions
-
Options for publishing a MediaStreamTrack.
Type:
Properties:
Name Type Argument Default Description priorityTrack.Priority <optional>
'standard' The priority with which the LocalTrack is to be published; In Group or Small Group Rooms, the appropriate bandwidth is allocated to the LocalTrack based on its Track.Priority; It has no effect in Peer-to-Peer Rooms; It defaults to "standard" when not provided
-
NetworkQualityConfiguration
-
Configure verbosity levels for network quality information for LocalParticipant and RemoteParticipants.
Type:
- object
Properties:
Name Type Argument Default Description localNetworkQualityVerbosity <optional>
1 Verbosity level for LocalParticipant
remoteNetworkQualityVerbosity <optional>
0 Verbosity level for RemoteParticipants
-
NetworkQualityLevel
-
NetworkQualityLevel is a value from 0–5, inclusive, representing the quality of a network connection.
Type:
- number
-
NetworkTiming
-
Represents network timing measurements captured during preflight test
Type:
- object
Properties:
Name Type Argument Description connectTimeMeasurement <optional>
Time to establish signaling connection and acquire turn credentials
mediaTimeMeasurement <optional>
Time to start media. This is measured from calling connect to remote media getting started.
dtlsTimeMeasurement <optional>
Time to establish dtls connection. This is measured from RTCDtlsTransport
connectingtoconnectedstate. (Not available on Safari)iceTimeMeasurement <optional>
Time to establish ice connectivity. This is measured from ICE connection
checkingtoconnectedstate.peerConnectionTimeMeasurement <optional>
Time to establish peer connectivity. This is measured from PeerConnection
connectingtoconnectedstate. (Not available on Firefox) -
OpusCodecSettings
-
Opus codec settings.
Type:
Properties:
Name Type Argument Default Description nameAudioCodec "opus"
dtxboolean <optional>
true Enable/disable discontinuous transmission (DTX); If enabled all published LocalAudioTracks will reduce the outgoing bitrate to near-zero whenever speech is not detected, resulting in bandwidth and CPU savings; It defaults to true.
-
PreflightOptions
-
You may pass these options to module:twilio-video.testPreflight in order to override the default behavior.
Type:
- object
Properties:
Name Type Argument Default Description regionstring <optional>
'gll' Preferred signaling region; By default, you will be connected to the nearest signaling server determined by latency based routing. Setting a value other than
gllbypasses routing and guarantees that signaling traffic will be terminated in the region that you prefer. Please refer to this table for the list of supported signaling regions.durationnumber <optional>
10000 number of milliseconds to run test for. once connected test will run for this duration before generating the stats report.
-
PreflightReportStats
-
Represents RTC related stats that were observed during preflight test
Type:
- object
-
PreflightTestReport
-
Represents report generated by PreflightTest.
Type:
- object
Properties:
Name Type Argument Description testTimingTimeMeasurement <optional>
Time measurements of test run time.
networkTimingNetworkTiming <optional>
Network related time measurements.
statsPreflightReportStats <optional>
RTC related stats captured during the test.
iceCandidateStatsArray.<RTCIceCandidateStats> <optional>
List of gathered ice candidates.
selectedIceCandidatePairStatsSelectedIceCandidatePairStats stats for the ice candidates that were used for the connection.
-
RemoteTrack
-
A RemoteTrack is a RemoteAudioTrack, RemoteVideoTrack, or RemoteDataTrack.
Type:
-
RemoteTrackPublicationOptions
-
RemoteTrackPublication options
Type:
- object
-
SelectedIceCandidatePairStats
-
Represents stats for a numerical metric.
Type:
- object
Properties:
Name Type Argument Description localCandidateRTCIceCandidateStats <optional>
selected local ice candidate
remoteCandidateRTCIceCandidateStats <optional>
selected local ice candidate
-
Stats
-
Represents stats for a numerical metric.
Type:
- object
Properties:
Name Type Argument Description averagenumber <optional>
average value observed.
maxnumber <optional>
max value observed.
minnumber <optional>
min value observed.
-
TrackPublicationOptions
-
TrackPublication options
Type:
- object
-
VideoBandwidthProfileOptions
-
VideoBandwidthProfileOptions allows you to configure how your available downlink bandwidth is shared among the RemoteVideoTracks you have subscribed to in a Group Room.
Type:
- object
Properties:
Name Type Argument Default Description dominantSpeakerPriorityTrack.Priority <optional>
"standard" Optional parameter to specify the minimum subscribe Track.Priority of the Dominant Speaker's RemoteVideoTracks. This means that the Dominant Speaker's RemoteVideoTracks that are published with lower Track.Priority will be subscribed to with the Track.Priority specified here. This has no effect on RemoteVideoTracks published with higher Track.Priority, which will still be subscribed to with with the same Track.Priority. If not specified, this defaults to "standard". This parameter only applies to a Group Room Participant when ConnectOptions.dominantSpeaker is set to true.
maxSubscriptionBitratenumber <optional>
Optional parameter to specify the maximum downlink video bandwidth in bits per second (bps). By default, there are no limits on the downlink video bandwidth.
clientTrackSwitchOffControlClientTrackSwitchOffControl <optional>
"auto" Optional parameter that determines when to turn the RemoteVideoTrack on or off. When set to "auto", SDK will use the visibility of the attached elements to determine if the RemoteVideoTrack should be turned off or on. When the attached video elements become invisible the RemoteVideoTrack will be turned off, and when elements become visible they will be turned on. When set to "manual" you can turn the RemoteVideoTrack on and off using the api RemoteVideoTrack#switchOn and RemoteVideoTrack#switchOff respectively.
contentPreferencesModeVideoContentPreferencesMode <optional>
"auto" This Optional parameter configures the mode for specifying content preferences for the RemoteVideoTrack. When set to "auto" the SDK determines the render dimensions by inspecting the attached video elements. RemoteVideoTracks rendered in smaller video elements will receive a lower resolution stream compared to the video rendered in larger video elements. When set to "manual" you can set the dimensions programmatically by calling RemoteVideoTrack#setContentPreferences.
maxTracksnumber <optional>
(deprecated: use "clientTrackSwitchOffControl" instead). Optional parameter to specify the maximum number of visible RemoteVideoTracks, which will be selected based on Track.Priority and an N-Loudest policy. By default there are no limits on the number of visible RemoteVideoTracks. 0 or a negative value will remove any limit on the maximum number of visible RemoteVideoTracks.modeBandwidthProfileMode <optional>
"grid" Optional parameter to specify how the RemoteVideoTracks' TrackPriority values are mapped to bandwidth allocation in Group Rooms. This defaults to "grid", which results in equal bandwidth share allocation to all RemoteVideoTracks.
renderDimensionsVideoRenderDimensions <optional>
(deprecated: use "contentPreferencesMode" instead). Optional parameter to specify the desired render dimensions of RemoteVideoTracks.trackSwitchOffModeTrackSwitchOffMode <optional>
"predicted" Optional parameter to configure how RemoteVideoTracks are switched off in response to bandwidth pressure. Defaults to "predicted".
-
VideoCodecSettings
-
Video codec settings.
Type:
- object
Properties:
Name Type Description codecVideoCodec Video codec name
-
VideoContentPreferences
-
Type:
- object
Properties:
Name Type Argument Description renderDimensionsVideoTrack.Dimensions <optional>
Render Dimensions to request for the RemoteVideoTrack.
-
VideoProcessor
-
A VideoProcessor, when added via VideoTrack#addProcessor, is used to process incoming video frames before sending to the encoder or renderer.
Type:
- object
Properties:
Name Type Description processFramefunction A callback to receive input and output frame buffers for processing. The input frame buffer contains the original video frame which can be used for additional processing such as applying filters to it. The output frame buffer is used to receive the processed video frame before sending to the encoder or renderer.
Any exception raised (either synchronously or asynchronously) in
processFramewill result in the frame being dropped. This callback has the following signature:
processFrame(
inputFrameBuffer: OffscreenCanvas,
outputFrameBuffer: HTMLCanvasElement
): Promise<void> | void;Example
class GrayScaleProcessor { constructor(percentage) { this.percentage = percentage; } processFrame(inputFrameBuffer, outputFrameBuffer) { const context = outputFrameBuffer.getContext('2d'); context.filter = `grayscale(${this.percentage}%)`; context.drawImage(inputFrameBuffer, 0, 0, inputFrameBuffer.width, inputFrameBuffer.height); } } -
VideoRenderDimensions
-
Type:
- object
- Deprecated:
-
- VideoRenderDimensions allows you to specify the desired render dimensions of RemoteVideoTracks. You can specify 'auto' for this field - which is also default value - based on Track.Priority. The bandwidth allocation algorithm will distribute the available downlink bandwidth proportional to the requested render dimensions. This is just an input for calculating the bandwidth to be allocated and does not affect the actual resolution of the RemoteVideoTracks.
Properties:
Name Type Argument Description highVideoTrack.Dimensions <optional>
Optional parameter to specify the desired rendering dimensions of RemoteVideoTrack whose Track.Priority is "high". 0 or a negative value will result in the lowest possible resolution. This defaults to 1280 x 720 (HD).
lowVideoTrack.Dimensions <optional>
Optional parameter to specify the desired rendering dimensions of RemoteVideoTrack whose Track.Priority is "low". 0 or a negative value will result in the lowest possible resolution. This defaults to 176 x 144 (QCIF).
standardVideoTrack.Dimensions <optional>
Optional parameter to specify the desired rendering dimensions of RemoteVideoTrack whose Track.Priority is "standard". 0 or a negative value will result in the lowest possible resolution. This defaults to 640 x 480 (VGA).
-
VideoTrackPublication
-
Type:
-
VP8CodecSettings
-
VP8 codec settings.
Type:
Properties:
Name Type Argument Default Description nameVideoCodec "VP8"
simulcastboolean <optional>
false Enable/disable VP8 simulcast; If enabled, Twilio's Video SDK will send three video streams of different qualities