VideoSDK Class Properties - Android
getSelectedAudioDevice()
-
type:
MicrophoneDeviceInfo? -
The
getSelectedAudioDevice()method returns the audio device the SDK is set to use.room.setAudioDevice()changes it. -
The SDK picks a device the first time you read it. It is
nullonly beforeVideoSDK.initialize()has run, or when the device reports no audio device at all.
val selectedAudioDevice: MicrophoneDeviceInfo? = VideoSDK.getSelectedAudioDevice()
Log.d("VideoSDK", "Selected audio device: ${selectedAudioDevice?.label}")
getActiveAudioDevice()
-
type:
MicrophoneDeviceInfo? -
The
getActiveAudioDevice()method returns the audio device that Android is actually playing the call audio through. While a change of audio device is still being applied, it can differ fromgetSelectedAudioDevice(). -
It is
nullbeforeVideoSDK.initialize()has run.
val activeAudioDevice: MicrophoneDeviceInfo? = VideoSDK.getActiveAudioDevice()
Log.d("VideoSDK", "Playing through: ${activeAudioDevice?.label}")
getSelectedVideoDevice()
-
type:
CameraDeviceInfo? -
The
getSelectedVideoDevice()method returns the camera the SDK opened last, or the one set withsetSelectedVideoDevice(). -
It is
nullbefore any camera has been used.
val selectedVideoDevice: CameraDeviceInfo? = VideoSDK.getSelectedVideoDevice()
Log.d("VideoSDK", "Selected camera: ${selectedVideoDevice?.label}")
Got a Question? Ask us on discord

