All integrations were made following the Zoom Video SDK documentation.
I’m having some unsolved issues in the documentation.
When the user opens the camera for the first time, hsot can close the camera, however, if the user activates the host again, it can no longer close it.
Below is the excerpt cited in the documentation I used:
stream.stopVideo().then(() => {
stream.detachVideo(USER_ID)
})
In my code I created the following function that receives the stream and the ID of the user I want to stop the camera from:
const stopVideo = async (mediaStream, userId) => {
setHiddenCamera(true)
setVideoStarted(false);
mediaStream.stopVideo().then(() => {
mediaStream.detachVideo(userId)
})
}
After the user opens the camera again, whenever I try to call the stopVideo function an error occurs in the console (camera is closed).
I would like to know if the host really does not have this control over the user’s camera or if there is something wrong in my implementation.
Below is more information about the versions and system I am using:
Video SDK version: 1.12.5
React version: 18
Next JS version: 14.2.2
OS: Windows 11
Browser: Google Chrome
Browser Version 129.0.6668.70 (Official Build) (64 bits)