Support Zoom web sdk screen share under chrome 72

Since zoom_electron does not support the new version of electron, we decided to use zoom web sdk instead.

Our plan is:

  1. Test the stability of zoom web sdk by abtest on electron 2.x
  2. Switch to zoom web sdk, abandon zoom_electron
  3. Upgrade electron to 4 or 5

However, the screen sharing of zoom web sdk only supports chrome 72 or higher, and electron 2.x is chrome@61.

Tencent has a solution: https://cloud.tencent.com/document/product/647/32251
They wrote a chrome plugin and captured the screen via chrome.desktopCapture, but this method requires zoom web sdk to do some change.

So I wonder if you guys can support this feature?

Hi @liubiantao,

Thanks for reaching out. Looking at this plugin details, it looks like it uses WebRTC. Unfortunately the webSDK doesn’t support WebRTC.

Thanks

The core question is how to get MediaStream. It is ok to use WebRTC or your own protocol after getting MediaStream.

Don’t look at the plugin details, let’s analyze the source code.

Chrome@72 and above, added a new getDisplayMedia API.
Compare the browser compatibility, you can find that Zoom web sdk also uses this API

More direct evidence is to search your source code:

You can use this API to get MediaStream, see the example:

document.querySelector('video').srcObject = await navigator.mediaDevices.getDisplayMedia({
  video: true,
  audio: true
});

So zoom web sdk does not support screen sharing below Chrome@72, because there is no getDisplayMedia.

Then look at the source code of the plugin:

The key is chrome.desktopCapture API.

chrome.desktopCapture.chooseDesktopMedia(screenOptions, port.sender.tab, onAccessApproved);

According to the onAccessApproved callback document:

streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn’t select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
chrome.desktopCapture  |  API  |  Chrome for Developers

In other words, streamId + getUserMedia is similar to getDisplayMedia .

Here I think your engineers should know how to do it.

In addition, in Electron, you can also get the streamId using desktopCapturer.getSources:

So could Zoom web sdk provide an interface that allows users to pass streamId or MediaStream to zoom to be compatible with Chrome@72 or below?

@liubiantao,

We will get back to you with an update on this shortly.

Thanks

I found Zoom Web Client works well in Chrome@61.
WX20190619-202924%402x

Prerequisites: Google Chrome 53.0.2785 or higher
https://support.zoom.us/hc/en-us/articles/214629443-Zoom-Web-Client

Then I researched Zoom Scheduler extension
https://chrome.google.com/webstore/detail/zoom-scheduler/kgjfgplpablkjnlkjmjdecgdpfankdl

This is exactly what I said yesterday.

Now I know how they work:

  1. zoom: check chrome and getDisplayMedia

  2. zoom: CHECK_CHROME_SHARING_EXTENSION

  3. zoom: send ‘WCL.getSourceID’ to extension

  4. extension: get sourceid

  5. extension: send ‘WCL.sharing’ + sourceid to zoom

Next, I need to write an extension to mock step 2-5.

BUT, I would be grateful if you could provide an official interface, thx :smile:

Hi @liubiantao,

We’ll talk with our product & engineering team to see if we can provide an interface for it.

Thanks