# JSMediaSdk\_Instance not defined

**URL:** <https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177>\
**Category:** Web\
**Created:** [February 21, 2020, 9:19am UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177 "2020-02-21T09:19:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![harald.glanzer](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@harald.glanzer](https://devforum.zoom.us/u/harald.glanzer)\
**Post date:** [February 21, 2020, 9:19am UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/1 "2020-02-21T09:19:02Z")

</div>

Hello again @zoom,

lately, we experienced a lot of connection failures using your WebSDK 1.7.0 client.  
we suspect that the problem was related to a bad(slow) uplink, maybe with additional sporadic packet loss + latency.

i am now simulating such a bad uplink using a ‘linktropy mini2’ WAN simulator, and get similar results with lots of connection failures when restricing the bandwith to 1MBit(or less) in both directions.

in particular, quite often i get ‘JSMediaSDK\_Instance is not defined’ js errors inside the browser running zoom web sdk. it looks like there is a timing issue, which may result in js\_media.min.js (from [https://source.zoom.us/1.7.0/lib/av/js\_media.min.js](https://source.zoom.us/1.7.0/lib/av/js_media.min.js)) not beeing loaded or being fetched too late.

i manually fetched js\_media\_min.js from [source.zoom.us](http://source.zoom.us), installed it locally and embed it via a tag (similar to including the zoom SDK).

now, it looks like the ‘JSMediaSDK\_Instance not defined’ errors are gone.

questions:

- is there some race condition regarding react.js and js\_media.min.js?
- is it ok to install js\_media.min.js locally, and include via a tag?
- are there other ‘static’ dependencies which could imported manually?

thx  
hari

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [February 21, 2020, 6:09pm UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/2 "2020-02-21T18:09:33Z")

</div>

Hey @harald.glanzer,

We will look into this issue and get back to you. (CS-1387)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![harald.glanzer](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@harald.glanzer](https://devforum.zoom.us/u/harald.glanzer)\
**Post date:** [February 25, 2020, 12:26pm UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/3 "2020-02-25T12:26:00Z")

</div>

hello again,

looks like this can be circumvented by setting

ZoomMtg.setZoomJSLib(‘http://[URL]/node\_modules/@zoomus/websdk/dist/lib’, ‘/av’);

… and copying ‘node\_modules/@zoomus/websdk/dist/lib’ to the corresponding webroot. this way, the AV libs dont need to be fetched from the default URL ([source.zoom.us](http://source.zoom.us) i guess), and JsMediaSDK\_Instance is known instantly…

@zoom: is it possible that this JsMediaSDK\_Instance - error can be triggered by calling ZoomMtg.join() BEFORE ZoomMtg.prepareJssdk(); and / or ZoomMtg.preLoadWasm(); have finished?

FYI  
hari

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [February 25, 2020, 4:28pm UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/4 "2020-02-25T16:28:29Z")

</div>

Hey @harald.glanzer,

After speaking with our Web SDK engineers, they have suggest you pre load those resource before the join meeting page.

[https://zoom.github.io/sample-app-web/ZoomMtg.html#preLoadWasm](https://zoom.github.io/sample-app-web/ZoomMtg.html#preLoadWasm)

For example:

```js
zoomJSLib='https://source.zoom.us/1.7.0/lib';
zoomJSAVLib='/av'
ZoomMtg.setZoomJSLib(zoomJSLib, zoomJSAVLib);

ZoomMtg.preLoadWasm();
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/sharing.wasm
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/audio.encode.wasm
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/video.decode.wasm
ZoomMtg.prepareJssdk();

// 1. add script to download requirements js file
// for IE
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/../webim.min.js"></script>
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/js_media_ie.min.js"></script>
// for No IE
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/../webim.min.js"></script>
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/js_media.min.js"></script>
// 2. add a node which WebSDK use
// <div id="zmmtg-root">
// <div data-reactroot="" class="meeting-app"></div>
// </div>
// react modal auto generation.
// <div class="ReactModalPortal"></div>

```

> [@harald.glanzer](#):
>
> is it possible that this JsMediaSDK\_Instance - error can be triggered by calling ZoomMtg.join() BEFORE ZoomMtg.prepareJssdk(); and / or ZoomMtg.preLoadWasm(); have finished?

Yes that is possible.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![developer-whova](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@developer-whova](https://devforum.zoom.us/u/developer-whova)\
**Post date:** [June 10, 2020, 9:38pm UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/5 "2020-06-10T21:38:05Z")

</div>

Can we have a Promise interface for these things?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 15, 2020, 9:02pm UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/6 "2020-06-15T21:02:16Z")

</div>

Hey @developer-whova,

Yes that is a great suggestion! 🙂

I will pass this to our Web SDK team.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:03pm UTC](https://devforum.zoom.us/t/jsmediasdk-instance-not-defined/8177/7 "2020-08-21T22:03:13Z")

</div>


