Sometimes javascript errors on load, no audio with chinese cdn, preloadWasm, no gzip compression on cdn files

Hi, I’m trying to integrate the web sdk (1.7.8) and I have a number of issues and questions.

  1. When I clear my browser cache (chrome) and then I try to join a meeting using the code below I sometimes get javascript errors on the first page load. This error seems to occur more often when I load the zoom files from the chinese CDN (slower downloading). And it also happens more often if the browser dev tools are open (with ‘Disable cache’ enabled in case that matters). If I then do page refresh I don’t get the errors anymore and the meeting works. What can be done about this?

ReferenceError: JsMediaSDK_Instance is not defined
TypeError: h.a.getCanvasInfo is not a function
TypeError: R.sendSocket is not a function
Uncaught ReferenceError: JsMediaSDK_Instance is not defined
Uncaught TypeError: g.a.connectSocket is not a function

  1. As I mentioned I am also testing the same code below but with the files loaded from the chinese CDN (jssdk.zoomus.cn). For some reason the audio does not work at all when the files are loaded from the chinese CDN. Video does work. The audio works correctly when I use the global CDN. What could cause this to happen?

  2. What does ‘ZoomMtg.preLoadWasm()’ do exactly? Is this required? Without this code the browsers downloads about 5MB worth of files. I can see that ‘preLoadWasm’ downloads an additional 5MB of ‘.wasm’ files (for a total download size of ± 10MB). But if I leave out ‘preLoadWasm()’ the meeting (audio+video) still works without download those large files.

  3. Maybe I’m looking at this wrong but it seems as though the css and javascript files loaded from the CDN’s are sent without any compression (e.g. gzip)? Why is that the case? Because those files would be quite a bit smaller with compression turned on.

<script src="https://source.zoom.us/1.7.8/lib/vendor/react.min.js"></script>
<script src="https://source.zoom.us/1.7.8/lib/vendor/react-dom.min.js"></script>
<script src="https://source.zoom.us/1.7.8/lib/vendor/redux.min.js"></script>
<script src="https://source.zoom.us/1.7.8/lib/vendor/redux-thunk.min.js"></script>
<script src="https://source.zoom.us/1.7.8/lib/vendor/jquery.min.js"></script>
<script src="https://source.zoom.us/1.7.8/lib/vendor/lodash.min.js"></script>

<script src="https://source.zoom.us/zoom-meeting-1.7.8.min.js"></script>

<script>
    console.log('check system requirements');
    console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.8/lib', '/av');
    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();
</script>

<script>
    $(function () {
        const meetConfig = {
            apiKey: 'abcdef',
            meetingNumber: '123456',
            passWord: 'pwd789', 
            leaveUrl: 'https://google.com/',
            userName: 'test',
            userEmail: '',
            role: 0
        };

		fetch('/api/GenerateSignature', {
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			body: JSON.stringify(meetConfig)
		})
			.then(result => result.text())
			.then(response => {
				ZoomMtg.init({
					leaveUrl: meetConfig.leaveUrl,
					success: function (res) {
						console.log('init meeting success');
						console.log(res);

						ZoomMtg.join({
							apiKey: meetConfig.apiKey,
							signature: response,
							meetingNumber: meetConfig.meetingNumber,
							passWord: meetConfig.passWord,
							userName: meetConfig.userName,
							userEmail: meetConfig.userEmail,
							success: function (res) {
								console.log('join meeting success');
								console.log(res);
							},
							error(res) {
								console.log(res);
							}
						})
					},
					error: function (res) {
						console.log(res);
					}
				})
			});
    })
</script>

Hey @henk.mahieu,

To prevent the browser console errors, make sure the Web SDK files have finished loading:

ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();

Interesting, can you provide steps to reproduce this issue?

Yes this is required, it allows the Web SDK to load the web assembly files in order for the Web SDK to work.

You are correct. I will talk to the team about minifying them.

Thanks,
Tommy

As you can see in my code in my original question I do in fact call those functions. But it seems that the websdk does not always wait until the files are done downloading before executing the next code and that may be causing the errors.

The step to reproduce are simple. Take my example code from my original question and replace all the references to the global cdn with the chinese cdn. With the global cdn I have audio, with the chinese cdn I do not have any audio. (Of course you also have to provide a valid apikey, meetingnumber, password and generate a valid signature.)

Ok. But as I said the meeting still seems to work without downloading those webassembly files so that seems a bit strange, no?

Ok thanks! Just a small clarification. I am talking about gzip compression not minification. The files are already minified, they are just nog gzipped.

Hey @henk.mahieu,

Yes, I suggest calling the functions before any init or join meeting action happens. Please try allowing a few seconds for those files to load. Let me know if that helps the issue.

Gotcha, I will pass this to our Web SDK team.

Thanks,
Tommy

I would love to be able to wait until those files are loaded but the websdk does not provide a way to do this. We would need a callback or a promise to be able to wait on it. We plan to have links directly to this kind of ‘join the meeting’ page (from an email for example) so there is no other place or time where we can ‘preload’ these files. The only other thing we could do is wait an arbitrary number of seconds before we initialize the meeting but there is no way to know how long we should wait because the network bandwidth of the end users can be very different.

Hey @henk.mahieu,

Correct, we are releasing the ability to do that in the next Web SDK 1.7.9 update:

Thanks,
Tommy

Thanks for the info! Any feedback on the audio issue when using the chinese CDN?

Hey @henk.mahieu,

Happy to help! The audio issues should be fixed in 1.7.9.

Once it is released, please let me know if you see any issues. :slight_smile:

Thanks,
Tommy