Get local media stream once when joining call
This commit is contained in:
parent
304dc2ac32
commit
e86bac90a0
3 changed files with 39 additions and 56 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue