Skip to main content
Version: 0.1.x

useMediaDevice Hook Event Callbacks - React

onDeviceChanged()

  • onDeviceChanged() is a callback which gets triggered whenever a media device, such as a camera, microphone, or speaker is connected to or removed from the system.

Example

function onDeviceChanged(devices) {
console.log("onDeviceChanged ", devices);
}

const {
...
} = useMediaDevice({
onDeviceChanged
});

Got a Question? Ask us on discord


Was this helpful?