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(); updateDevices();
mediaHandler.on("MediaHandler.localStreamsChanged", updateDevices); mediaHandler.on("local_streams_changed", updateDevices);
navigator.mediaDevices.addEventListener("devicechange", updateDevices); navigator.mediaDevices.addEventListener("devicechange", updateDevices);
return () => { return () => {
mediaHandler.removeListener( mediaHandler.removeListener("local_streams_changed", updateDevices);
"MediaHandler.localStreamsChanged",
updateDevices
);
navigator.mediaDevices.removeEventListener("devicechange", updateDevices); navigator.mediaDevices.removeEventListener("devicechange", updateDevices);
}; };
}, []); }, []);