Global or CDN libraries?

Hi,

We have users on our application who permanenlty get this kind of javascript error:

Just because ZoomMtg is undefined on the window object:

const libPath = `https://dmogdx0jrul3u.cloudfront.net/${meta.sdkVersion}/lib`;
window.**ZoomMtg**.setZoomJSLib(libPath, '/av');

Looks like the related zoom libraries cannot be downloaded and provoke this error. The libraries are downloaded with a link on zoom.us, while as show on the above code, they are initialized with a link using the CDN.

So i was looking at the code to verify how these libraries are loaded and found it’s exactly the same way as described in your official documentation here

It seems that the documentation recommend to use a mix of Global & CDN URLs.
My questions are the following one:

  • I understand local & CDN concepts here, but what Global refers to exactly ? And what are the differences between Global & CDN ?
  • Would not it be simpler to just use the CDN link (cloudfront.net/) everywhere instead of the zoom “Global” one ?

Thank you in advance for your (zoom and / or community) insights :slight_smile:

Hey @nvivot,

The import { ZoomMtg } from '@zoomus/websdk' is for the Local version.

Are you using the CDN version or the Local version? It sounds like you could be using both which could create some issues.

Thanks,
Tommy

Hi Tommy,

Sorry, my bad. I have checked the code on the wrong branch.

We are using the CDN version, with no node import and this kind of script (i have updated the original post to avoid confusion:

const libPath = `https://dmogdx0jrul3u.cloudfront.net/${meta.sdkVersion}/lib`;
window.ZoomMtg.setZoomJSLib(libPath, '/av');

Hey @nvivot,

Could you please provide a sample Web SDK GitHub repo with this issue so we can reproduce and debug the issue locally?

Thanks,
Tommy

Hi Tommy,

I don’t need you to reproduce the error but to answer my question(s) regarding the fact that we mix global and CDN urls to download and initialize Zoom libraries / components. And by “we” i’m not just talking about my team with our application, but also about your company in the sample application and provided tutorials.

Wouldn’t it make sense to only use CDN links everywhere ?

I cannot provide a sample repository.

Below you have some sample code for testing, nothing new that is not on your demo application already.

<!DOCTYPE html>
<html lang="en">
  <head>

    <link rel="stylesheet" href="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/css/bootstrap.css" />
    <link rel="stylesheet" href="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/css/react-select.css" />
    <link rel="stylesheet" href="/css/meeting.css" />
  </head>
  <body>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/react.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/react-dom.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/redux.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/redux-thunk.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/jquery.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/lodash.min.js"></script>
    <script src="https://source.zoom.us/zoom-meeting-<%= process.env.ZOOM_SDK_VERSION %>.min.js"></script>
    <script src="/js/meeting.js"></script>
  </body>
</html>

/js/meeting.js refers to our main entry point script, the first instruction lines are the following ones (the one provoking the error)

const libPath = `https://dmogdx0jrul3u.cloudfront.net/${meta.sdkVersion}/lib`;
window.ZoomMtg.setZoomJSLib(libPath, '/av');

ZoomMtg does not seems to be initialized and provoke the error.

We never got such issue when we were using the NPM version so the only reason (from my understanding) for this to fail is because the libraries were not available on zoom web site. If you know other potential reasons i’m listening.

Hey @nvivot,

Apologies for the confusion! :slight_smile:

I will get back to you on your original questions:

Thanks,
Tommy

1 Like

Thanks @tommy

No need.

It looks like source.zoom.us is just a CNAME for your AWS CloudFront host name.

So in the end both host name are the same services, which answer to my question : we can put any of both host name for any zoom resources.

Global and CDN terms from your documentation are the same thing then.

1 Like

Hey @nvivot,

Yes, I was just about to reply, source.zoom.us and the CDN version url are both the same. We will update the docs to only show source.zoom.us.

Thanks,
Tommy

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.