How can I properly release microphone and camera resources when a participant hangs up a call in my WebRTC application? #5251
-
Let's say two participants are on an ongoing call and if any of the parties hangups the call, the client application should properly release the mic/camera.
Question: How and when should we release the microphone and camera resources to address this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
From time to time we forget to close all tracks after the call is finished and because of the track is still in use, the camera light won't turn off. You have to stop them like this:
|
Beta Was this translation helpful? Give feedback.
-
Update: I think the easiest part to close streams and dispose recording icon, just call
If you want to disconnect from websocket and clear all peer connections, just call
Another option is to turn off the camera for video stream. It turnoff the camera light.
On the other hand, recording icon is still there. I think it's whether about permission or microphone usage. I just need to check if it can be disposed completely. |
Beta Was this translation helpful? Give feedback.
Update:
I think the easiest part to close streams and dispose recording icon, just call
If you want to disconnect from websocket and clear all peer connections, just call
Another option is to turn off the camera for video stream. It turnoff the camera light.
On the other hand, recording icon is still there. I think it's whether about permission or microphone usage. I just need to check if it can be disposed completely.