Video SDK CDN Pure JS JsMediaSDK_Instance is not defined

Hi there!
I am implementing Video SDK in Web with pure JS and following the below link:
https://marketplace.zoom.us/docs/sdk/video/web/get-started/

First I have included script file:

<script src="https://source.zoom.us/videosdk/zoom-video-1.6.0.min.js"></script>

after that:

const ZoomVideo = window.WebVideoSDK.default;
const client = ZoomVideo.createClient();
let stream;

after this I am generating the signature and than I try to start the session as:

client.join(topic, token, userName, password).then(() => {
  stream = client.getMediaStream()
}).catch((error) => {
  console.log(error)
})

in above lines I get 2 error messages in browser console as:

Uncaught ReferenceError: JsMediaSDK_Instance is not defined
    at Gi.init (zoom-video-1.5.0.min.js:1:117627)
    at zoom-video-1.5.0.min.js:1:192413
    at t.project (zoom-video-1.5.0.min.js:1:167985)
    at t._next (zoom-video-1.5.0.min.js:1:43999)
    at t.next (zoom-video-1.5.0.min.js:1:5497)
    at t._next (zoom-video-1.5.0.min.js:1:48398)
    at t.next (zoom-video-1.5.0.min.js:1:5497)
    at t._next (zoom-video-1.5.0.min.js:1:31848)
    at t.next (zoom-video-1.5.0.min.js:1:5497)
    at t._next (zoom-video-1.5.0.min.js:1:31848)

and 2nd one as:

Uncaught TypeError: Cannot read properties of undefined (reading 'userRole')
    at t.project (zoom-video-1.5.0.min.js:1:286143)
    at t._tryNext (zoom-video-1.5.0.min.js:1:27759)
    at t._next (zoom-video-1.5.0.min.js:1:27661)
    at t.next (zoom-video-1.5.0.min.js:1:5497)
    at t._next (zoom-video-1.5.0.min.js:1:31848)
    at t.next (zoom-video-1.5.0.min.js:1:5497)
    at t._next (zoom-video-1.5.0.min.js:1:48398)
    at t.next (zoom-video-1.5.0.min.js:1:5497)
    at t._next (zoom-video-1.5.0.min.js:1:31848)
    at t.next (zoom-video-1.5.0.min.js:1:5497)

Is there any other script reference that I need to include along, any advise on it is highly appreciated.
Thanks in advance

1 Like
const ZoomVideo = window.WebVideoSDK.default;
const client = ZoomVideo.createClient();
let stream;

after that try to do

client.init('US-en','CDN')

after that, generate your token
and do

client.join(topic, token, userName, password).then(() => {
  stream = client.getMediaStream()
}).catch((error) => {
  console.log(error)
})

let me know if this helps

Thanks for your reply, I was already doing that, however I was doing it like:

client.init('en-US', 'CDN')

instead of

client.init('US-en','CDN')

I changed to what you suggested but still no hope.

By the way another error also shows up before these errors as:

zoom-video-1.5.0.min.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'append')
    at zoom-video-1.5.0.min.js:1:325862
    at zoom-video-1.5.0.min.js:1:325976
    at new Promise (<anonymous>)
    at yg.init (zoom-video-1.5.0.min.js:1:325525)
    at e.value (zoom-video-1.5.0.min.js:1:490021)
    at index.html:34:11

and in index.html 34:11 points to

client.init('en-US', 'CDN')

I got it resolved by moving my javascript code in the footer of the page, so either moving code to footer or in document ready or onload function it works.

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