Skip to main content

Manage Media Devices

Media devices represents the hardware for the camera, microphone and speaker devices. To get the list of media devices that are currently being used, you can use the following methods:

For audio devices:

To get audio devices, use getAudioDevices() method on localUser object. It returns List<DyteAudioDevice> object, where each object in the list refers to an audio device of the system.

// Get all audio devices
final audioDevices = await dyteClient.localUser.getAudioDevices();

For video devices

To get audio devices, use getVideoDevices() method on localUser object. It returns List<DyteVideoDevice> object, where each object in the list refers to an video device of the system.

// Get all video devices
final videoDevices = await dyteClient.localUser.getVideoDevices();

Set Audio Device

To set an active audio device, you can call setAudioDevice() method. This takes a DyteAudioDevice object that needs to be set active for audio.

await dyteClient.localUser.setAudioDevice(device);

Set Video Device

To set a active video device, you can call setVideoDevice() method. This takes a DyteVideoDevice object that needs to be set active for video.

await dyteClient.localUser.setVideoDevice(device);