Share Screen functionality is not working as expected in version 1.12.17

Hi Team,
I’m Sharma S S, developer from WeKan Enterprises. I’m trying to integrate zoom-video-sdk of version 1.12.17 into our application, after that observing that camera, audio are working as expected but screen share functionality is not working as expected.

Issue:
When attempting to start screen sharing using the Zoom Video-SDK for Web, I consistently get the following runtime error:
Environment:

  • @zoom /videosdk: 2.2.0 (also tested with 1.12.17)

  • React: 18.2.0

  • react-dom: 18.2.0

  • Browser: Chrome (latest), also tested on Firefox/Edge

  • OS: Windows 10

  • Build tools: react-scripts 5.0.1, TypeScript 5.5.x

  • npm version : 10.8.2

Attaching below the error that I’m facing :

Uncaught runtime errors:
ERROR
Cannot read properties of null (reading ‘addEventListener’)
TypeError: Cannot read properties of null (reading ‘addEventListener’)
at http: // localhost :3000/lib/js_media.min.js:1:421618
at new Promise ()
at e.Start_Desktop_Sharing (http: // localhost: 3000/lib/js_media.min.js:1:418478)
at e.handleDesktopCapture (http :// localhost :3000/lib/js_media.min.js:1:440421)

Here are the below things that I’ve tried

  • I am passing a real, visible, and properly sized

  • I have confirmed via console logs that the element exists, is attached to the DOM, and has the correct size at the moment the SDK is called.

  • The ref flow matches the working Zoom sample (My-meetings), and the element is not null or undefined.

  • I have tried both rendering the

  • I have tried using a < canvas > as well, but the SDK requires a

  • The error persists across browsers and after cleaning/reinstalling all dependencies.

#Questions:

  • Is there any additional requirement or timing consideration for the DOM element passed to startShareScreen?

  • Are there any known issues with the SDK version 2.2.0 (or 1.12.17) and React 18?

  • Is there a recommended way to ensure the element is “ready” for the SDK, beyond what is described above?

  • Are there any browser-specific quirks or additional initialization steps required?

Please let me know if there is any info regarding the above issue or anything that needs to be tried from my end.

Thanks!

Hey @Sharma

Thanks for your feedback.

Could you share some problematic session IDs with us for troubleshooting purposes?

Thanks
Vic

Hi @vic.yang
Thanks for writing back.
sharing problematic session id below
6825a18ce46da59fc0d7e4a0

Hi @Sharma

6825a18ce46da59fc0d7e4a0

This doesn’t appear to be a valid session ID. You can obtain it from the Web Portal by navigating to Dashboard → Past Sessions or Live Sessions. Alternatively, if you’re currently in a session, you can retrieve it using client.getSessionInfo().sessionId

Thanks
Vic

Hi @vic.yang ,
Got it now
Sharing the session ids here :

08f24fa9777dbb88eec1
fwZmyC19Rn+ddFRfNQkKiA==

08f24fa9777dbb88eec1
O5x2LXnZSbmnWNzmTuO2YQ==

please let me know if any further info is required

Hi @Sharma

fwZmyC19Rn+ddFRfNQkKiA==
O5x2LXnZSbmnWNzmTuO2YQ==

After analyzing the logs, we found that you may have forgotten to update the dependent assets and are still using a very old version. You can manually copy the contents from node_modules/@zoom/videosdk/dist/lib to the public/lib directory.

However, we still recommend not setting the second parameter of client.init, so that the Video SDK uses the dependent assets from the Zoom CDN, which ensures version consistency.

Thanks
Vic

1 Like

Hi @vic.yang
Thank you so much your suggestion worked and I’m able to implement screen share in my application with chrome but I’m facing an issue with safari browser.
The screen share button when i click ‘share screen’ option isn’t loading.
please find the session id below -
08f24fa9777dbb88eec1
J2AZkODiS/um9Bgdz8nGdw==

Hi @Sharma

J2AZkODiS/um9Bgdz8nGdw==

We found in the logs that when calling the startShareScreen method, it returned

"type: INVALID_PARAMETERS with the reason: “Expected to accept HTMLCanvasElement, but actual it is HTMLVideoElement.”

It seems that the wrong element might have been passed, which caused screen sharing to fail.

Please refer to the usage guide in this article:

Thanks
Vic

sure @vic.yang
Thanks a lot. It helped me resolve the issue