zoom / videosdk-ui-toolkit-web

The Zoom Video SDK UI toolkit is a prebuilt video chat user interface powered by the Zoom Video SDK.
https://www.npmjs.com/package/@zoom/videosdk-ui-toolkit
Other
8 stars 6 forks source link

Can't get access to ZoomVideoClient inside UI toolkit #13

Closed AlexanderKapelyukhovskiy closed 4 months ago

AlexanderKapelyukhovskiy commented 5 months ago

I would like to get access to ZoomVideoClient like this:

import { uitoolkit } from '@zoom/videosdk-ui-toolkit';

// Assuming uitoolkit provides an event or callback when a session is joined
uitoolkit.onSessionJoined((sessionInfo: any) => {
    // Access the ZoomVideoClient instance from the sessionInfo object
    const zoomVideoClient = sessionInfo.videoClient;
    // Now you can use zoomVideoClient to access methods or properties of ZoomVideoClient
    zoomVideoClient.getAllUsers().then(users => {
        console.log(users);
    }).catch(error => {
        console.error(error);
    });
});

// Call joinSession method provided by the UI toolkit
uitoolkit.joinSession(/* Pass necessary parameters */);

this is no videoClient property in sessionInfo. Could you please advise proper way?

Ticorrian-Heard commented 4 months ago

Hi!

This feature is not available as of now for the uikit callback functions, but I can log this as a feature request.

What would be your use case for using the videoClient outside of the uitoolkit?

AlexanderKapelyukhovskiy commented 4 months ago

For my case I need to have a control over session outside toolkit control. I need to hide leave/exit button and put same functionality outside. uitoolkit.closeSession() is not working well for me. But in general I would like to have ability to use full SDK functionality. SDK provides so many functions and I don't see a reason of limiting ui toolkit clients to be rooted to only 8 functions from UIToolkit interface.

Ticorrian-Heard commented 4 months ago

I see, thank you for sharing. After discussing with my team, we do not currently have plans of making the videoClient available through a callback. But technically, this videoclient object is a singleton so you should be able to import it directly from the base web video sdk by using: import ZoomVideo from '@zoom/videosdk';

and retrieve the instance after joining the session using: const client = ZoomVideo.createClient(); console.log(client.getAllUser());

Please note that this is a workaround and unexpected behavior with the UI updates might occur depending on the features you choose to use. In that case, support from my team is limited.

AlexanderKapelyukhovskiy commented 4 months ago

Thank you for your support! I appreciate prompt response!