Fix media handler event

This commit is contained in:
Robert Long 2021-11-29 14:43:13 -08:00
parent 9a5f40baa0
commit 3cccb86902

View file

@ -349,14 +349,11 @@ function useMediaHandler(client) {
updateDevices();
mediaHandler.on("MediaHandler.localStreamsChanged", updateDevices);
mediaHandler.on("local_streams_changed", updateDevices);
navigator.mediaDevices.addEventListener("devicechange", updateDevices);
return () => {
mediaHandler.removeListener(
"MediaHandler.localStreamsChanged",
updateDevices
);
mediaHandler.removeListener("local_streams_changed", updateDevices);
navigator.mediaDevices.removeEventListener("devicechange", updateDevices);
};
}, []);