JSMediaSdk_Instance not defined

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) not beeing loaded or being fetched too late.

i manually fetched js_media_min.js from 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

Hey @harald.glanzer,

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

Thanks,
Tommy

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 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

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

For example:

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>

Yes that is possible.

Thanks,
Tommy

1 Like

Can we have a Promise interface for these things?

2 Likes

Hey @developer-whova,

Yes that is a great suggestion! :slight_smile:

I will pass this to our Web SDK team.

Thanks,
Tommy

1 Like