useMediaDevice Hook Event Callbacks - React Native
onAudioDeviceChanged()
onAudioDeviceChanged()
is a callback which gets triggered whenever a audio devices, such as a microphone or speaker is connected to or removed from the device.
info
Make sure you have microphone permission granted on the device, otherwise, this event will not return the list.
Example
import { Constants, useMediaDevice } from "@videosdk.live/react-native-sdk";
function onAudioDeviceChanged(devices) {
console.log("onAudioDeviceChanged ", devices);
}
const {
...
} = useMediaDevice({
onAudioDeviceChanged
});
Got a Question? Ask us on discord