mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-23 05:07:03 +00:00
Get local media stream once when joining call
This commit is contained in:
@@ -225,12 +225,21 @@ export function useVideoRoom(manager, roomId, timeout = 5000) {
|
||||
|
||||
manager.on("participants_changed", onParticipantsChanged);
|
||||
|
||||
manager.join();
|
||||
|
||||
setState((prevState) => ({
|
||||
...prevState,
|
||||
joined: true,
|
||||
}));
|
||||
manager
|
||||
.join()
|
||||
.then(() => {
|
||||
setState((prevState) => ({
|
||||
...prevState,
|
||||
joined: true,
|
||||
}));
|
||||
})
|
||||
.catch((error) => {
|
||||
setState((prevState) => ({
|
||||
...prevState,
|
||||
joined: false,
|
||||
error,
|
||||
}));
|
||||
});
|
||||
|
||||
return () => {
|
||||
manager.removeListener("participants_changed", onParticipantsChanged);
|
||||
|
||||
Reference in New Issue
Block a user