Advance
Defaults Configuration
await DyteClient.init({
defaults: {
...
}
})
While initializing DyteClient you can pass configuration overrides, the available options are
type DefaultOptions {
video?: boolean;
audio?: boolean;
screenShare?: {
displaySurface?: 'window' | 'monitor' | 'browser';
};
mediaConfiguration?: {
video?: VideoQualityConstraints,
audio?: AudioQualityConstraints,
}
isNonPreferredDevice?: (device: MediaDeviceInfo) => boolean;
/**
* If true, will automatically switch audio input and output device
* to a new device connected mid call. (In case of disconnection switch
* will happen automatically in both cases)
*/
autoSwitchAudioDevice?: boolean;
recording?: RecordingConfig;
}
audio, video
This optional propery is true by default and defines whether audio or video would be acquired and enabled on SDK initialization
** Change default audio / video settings (())
By default as soon as you join the meeting the SDK will produce your video and audio streams.
const meeting = await DyteClient.init({
authToken,
defaults: {
audio: false, // Disable user's audio by default
video: true, // Enable user's video by default
},
});
screenShare.displaySurface
Specifies the preferred screenshare surface, user will still be shown all possible options but the one configured here will be preselected
Allowed values: window
, monitor
, browser
https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#displaysurface
mediaConfiguration
Defines media quality configuration
For audio -
{
echoCancellation?: boolean, // default true
noiseSupression?: boolean, // default true
autoGainControl?: boolean, // default true
enableStereo?: boolean, // default false
enableHighBitrate?: boolean // default false
}
For applications where audio quality needs to be high and as loseless as possible
{
echoCancellation: false,
noiseSupression: false,
autoGainControl: false,
enableStereo: true,
enableHighBitrate: true,
}
For video -
{
width: { ideal: number },
height: { ideal: number },
frameRate?: { ideal: number },
}
isNonPreferredDevice
Our SDK will acquire media devices preferring virtual devices to not be selected by default (OBS, iPhone continuity) You can override this logic by using your own function to decide the preference
defaults: {
...
isNonPreferredDevice: (device: MediaDeviceInfo) => {
if(device.label.startsWith("Virtual")) {
return false
}
}
}
autoSwitchAudioDevice
By default, when a new audio device is plugged in our SDK switches to that device. You can configure that behaviour
recording
{
fileNamePrefix?: string;
videoConfig?: {
height?: number;
width?: number;
codec?: string;
};
}
Refer to recording codec guide for info the codec
parameter