Where does the webviewId come from in drawWebView method?

The Zoom Apps SDK describes a drawWebView method, which contains a webviewId as follows:

zoomSdk.drawWebView({   webviewId: 'xxx'    x: 'xxx', y: 'xxx', width: 'xxx', height: 'xxx', zIndex:'xxx'})

However, nowhere else in the documentation is a webview ID mentioned. How does one get the webview ID of the current app? Or is there some undocumented method to create a new webview?

Thanks for the clarification!

The webviewId is just any string that you can pick.

Hi Jonathan, thanks for the quick reply.

When picking a random string for the webviewId, the drawWebView method returns {message: success}, but doesn’t seem to actually render anything.

How can the relevant ID for the App’s view be obtained so it can be rendered? Or, alternatively, how can a new webview + ID be created so it can actually be rendered using drawWebView?

Thanks again!

When activating Camera Mode by calling runRenderingContext(), the WebView will automatically be generated. Please make sure that it has fully loaded before calling drawWebView().

Yes, runRenderingContext() is called first. It returns {message: success}.

Then calling drawParticipant, for example, will draw a participant on the rendering context as expected.
However, calling drawWebView in the same way does nothing.

Here’s a more specific example: say I want to render a participant, and then render a webview on top of part of the context. I’d expect I could call drawParticipant and then drawWebView (with relevant dimensions and Z-index) to achieve this, but it does not seem to work.

Would it be possible if you could share your code for calling drawWebView()?

Surely:

const draw_webview_options = {
        webviewId: "123", 
        x: "0px", 
        y: "0px", 
        width: "300px", 
        height: "300px", 
        zIndex: "2"
      };
let draw_webview_response = await zoomSdk.drawWebView(draw_webview_options);

Instead of using strings in the parameters for x, y, width, height and zIndex, can you try using just numbers?

const draw_webview_options = {
webviewId: “123”,
x: 0,
y: 0,
width: 300,
height: 300,
zIndex: 2
};

Thanks Jonathan, that works.

You folks might want to update the documentation. Or better yet have all the draw methods accept a consistent variable type (or allow them to accept both strings and numbers).

Thanks!

Thank you for finding this bug. We are updating the docs to use numbers instead of strings. :blue_heart:

1 Like