Dont understand to switch camera from the app to the client

Zoom Apps configuration

  • Vanilla JS, Node.js Sample Zoom App with Node JS.

Hello, I do not understand with the structure how from a button on my application, order the client to change a camera by another. I do not understand the structure and I can not request the client with its SDK (impossible to import on the node.js server)…

I wonder how to do it, I have my button on the server with my index.pug page and I would like it to switch camera on the client but I do not understand how I can do it…

I need to use a Zoom App.

I thank you very much.

You could use the zoomSdk.listCameras() api to get the list of cameras, and zoomSdk.setCamera() api to change the camera.

Hope this helps!

Hi !!
Thanks for your help.

Now, I need help to implement it. Because starting from the zoomapps sample js: I don’t understand how I can import the SDK into the “server” folder and also how I can communicate with the client and order him to change cameras with it.

I don’t know what the “public” folder in the sample corresponds to. Who already has the SDK imported in the example but I don’t know how to make the link between the two…

It seems so simple and yet I don’t understand how concretely from this zoomapps-sample-js project I can manage to use the sdk ON THE CUSTOMER to change cameras… I can only change the index.pug pages and the routes…

Thanks for all !!!
Best regards

@thomas.caruchet The Zoom SDK cannot be imported server-side necessarily. If you wanted to add it to the pug, then you would create a script tag and enter JS there. However, that would still be in the client.

Instead, it currently serves the public/js/index.js file where the Zoom SDK is already imported and you can start building from there.

index.pug then uses that file in its own script tag.

I hope that helps!

Hi ! Thanks for your answer !

I will try like that, if I need help again, I will post here.

So, the public/js/index.js « import » the index.pug of the server.
I will try to order the public from the server to change the camera !

Best regards :slight_smile:

I’m glad that helped! Yes, index.pug uses public/js/index.js so you should only really need to change index.js in most cases.

Here is a fork of the Basic Sample App that implements immersive mode:

It’s a bit complex and could benefit from a framework but let me know if you have any questions!