How to destroy azure call instance?
Vashram Berani
0
Reputation points
I have implemented the Azure video call 1:1 users, and it's working fine the first time, But if the user disconnects the call and call again then it's through an error as shown below in the screenshot
Code for joining room
const callAzurClient = new CallClient();
let tokenCredential = new AzureCommunicationTokenCredential(accessToken);
callAgent.current = await callAzurClient.createCallAgent(tokenCredential);
deviceManager.current = await callAzurClient.getDeviceManager();
const camera = selectedCamera ? selectedCamera : (await deviceManager.current.getCameras())?.[0];
const localVideoStream_ = localVideoStream ? localVideoStream : await createLocalVideoStreamCommon(camera);
const videoOptions = localVideoStream_ ? { localVideoStreams: [localVideoStream_] } : undefined;
const roomCallLocator = { roomId: roomId };
call.current = callAgent.current.join(roomCallLocator, { videoOptions });
It's through error while calling a second time.
Is there any way to destroy previously created instances?
Sign in to answer