VideoSDK Class Events - Android
onAudioDeviceChanged()
- This event will be emitted when an audio device, is connected to or removed from the device.
Example
- Kotlin
- Java
VideoSDK.setAudioDeviceChangeListener(object : VideoSDK.AudioDeviceChangeEvent {
override fun onAudioDeviceChanged(
selectedAudioDevice: AudioDeviceInfo?,
audioDevices: MutableSet<AudioDeviceInfo>?
) {
Log.d(
"VideoSDK",
"Selected Audio Device: " + selectedAudioDevice.label
)
for (audioDevice in audioDevices) {
Log.d("VideoSDK", "Audio Devices" + audioDevice.label)
}
}
})
VideoSDK.setAudioDeviceChangeListener(new VideoSDK.AudioDeviceChangeEvent() {
@Override
public void onAudioDeviceChanged(AudioDeviceInfo selectedAudioDevice, Set<AudioDeviceInfo> audioDevices) {
Log.d("VideoSDK", "Selected Audio Device: " + selectedAudioDevice.getLabel());
for (AudioDeviceInfo audioDevice :
audioDevices) {
Log.d("VideoSDK", "Audio Devices" + audioDevice.getLabel());
}
}
});
Got a Question? Ask us on discord