Skip to main content

Advance

Defaults Configuration

useEffect(() => {
initMeeting({
defaults: {
...
},
});
}, []);

While initializing DyteClient you can pass configuration overrides, the available options are

type DefaultOptions {
video?: boolean;
audio?: boolean;
mediaConfiguration?: {
video?: VideoQualityConstraints,
audio?: AudioQualityConstraints,
screenshare?: ScreenshareQualityConstraints,
}
isNonPreferredDevice?: (device: MediaDeviceInfo) => boolean;
autoSwitchAudioDevice?: boolean;
recording?: RecordingConfig;
}

audio, video

This optional property is true by default and defines whether audio or video would be acquired and enabled on SDK initialization as soon as you join the meeting the SDK will produce your video and audio streams by default.

useEffect(() => {
initMeeting({
authToken: '<auth-token>',
defaults: {
audio: false,
video: false,
},
});
}, []);

mediaConfiguration.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