updateSendSettings()

updateSendSettings({sendSettings})

The updateSendSettings() method is used to modify how a client publishes both the local camera and custom video tracks. This method can be used to configure the simulcast layer encodings and to control which layers a client publishes.

Modifying these settings can help to improve the call quality when a user is connecting from a poor network or experiencing a high CPU load. Alternatively, these settings can be modified to improve visual performance when clients need to send higher quality video.

Presets

Camera and custom video tracks

To make it easier to select the right layer, Daily provides three presets for common use cases:

  • 'quality-optimized': Optimized for good networks, resulting in higher resolutions at a higher bitrate.
  • 'bandwidth-and-quality-balanced': Designed to be flexible for most networks, resulting in high resolutions while conserving bandwidth.
  • 'bandwidth-optimized': Optimized for lower bandwidth networks, such as cellular networks. Delivers the best quality for bandwidth constrained connections.

In addition to the defined presets, you can reset the simulcast layers to their default settings by using the 'default-video' preset. The 'default-video' preset uses the 'bandwidth-and-quality-balanced' settings.

Screen shares

For screen share tracks, there are three presets:

  • 'detail-optimized': A lower bitrate and frame rate option, optimized for static content, like PowerPoint slides. Use this setting to conserve bandwidth when content doesn't require a high frame rate. The max frame rate is 5 fps.
  • 'motion-and-detail-balanced': A balanced option, which is optimized for collaborative work including whiteboarding, document editing, code reviews, and more. This option uses slightly more bitrate and has a max frame rate of 15 fps.
  • 'motion-optimized': Optimized for full motion content, such as streaming YouTube or video files. This option utilizes a 2 Mbps bandwidth cap to prevent call quality from being impacted by a very high bitrate screen share. The screen share video has a max frame rate of 30 fps.

In addition to the defined presets, you can reset the simulcast layers to their default settings by using the 'default-screen-video' preset. The 'default-screen-video' preset uses the 'motion-optimized' settings.

Send settings

Send settings are passed as an object with one of the following keys:

  • video:
    • Defines the simulcast settings that are used to publish the local camera.
  • screenVideo: Defines the simulcast settings that are used to publish screen share tracks.

Any of the keys above can take one of the presets or an object with the video send settings.

  • The available presets are:
    • video: 'default-video', 'quality-optimized', 'bandwidth-and-quality-balanced', and 'bandwidth-optimized'.
    • screenVideo: 'default-screen-video', 'detail-optimized', 'motion-and-detail-balanced', and 'motion-optimized'.
  • Custom encodings are specified as RTCRtpEncodingParameters. You can specify encodings for up to three layers. Layers should be specified starting from "low" and progressing to "medium" then "high". For example, if only two layers are specified, they should be assigned to the "low" and "medium" layers only.
  • maxQuality specifies the highest simulcast layer published. The layer specified and all lower layers are published. For example, if a maxQuality of "medium" is set, then both the "medium" and "low" layers are published.
As a best practice, you should only ever send one `screenVideo` simulcast layer. While additional layers are supported, screen shares are very bandwidth intensive and sending more than one layer can have adverse performance impacts on your application. To use a single layer, define only the `"low"` simulcast layer and set `maxQuality` to `"low"`

Examples

Change the local camera to use a different preset:

Change the local camera to use a maxQuality of "medium", which results in publishing both the low and medium simulcast layers:

Returns

A successful call to updateSendSettings() triggers an 'send-settings-updated' event, and returns a Promise that resolves with an object with the new send settings: