How to add recording functionality in my video calls

Hello,

I’m following this guide https://marketplace.zoom.us/docs/sdk/native-sdks/Web-Client-SDK/getting-started/integrate-the-sdk

How can I record the video meetings?

I found in the documentation section some related functions

ZoomMtg.record({
   record: true
});

and

ZoomMtg.showRecordFunction({
show: false
 });

but I don’t know how to integrate them in the sample app. Should they be inside the ZoomMtg.init function or what.

It’s also worth mentioning that the video call is taking place between an Android mobile device and a Web client. I want to be able to download the recorded video to my desktop.

Hey @tony,

Basically the sample code and code you have are for joining a meeting and to record a meeting, you need to be the host.

I am working on creating an example of having the web SDK be the host so you can use the recording functionality.

I will send you what I come up with.

Thanks,
Tommy

1 Like

Hey @tony,

In order to add recording functionality, the role must be set to 1 in the meetConfig object. This makes you the host when you join a meeting.

Then, you can add the functions you found into the ZoomMtg.join callback success function. Here is the sample-app-web code modified to record a meeting,

(function() {

  console.log('checkSystemRequirements');
  console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));

  // it's option if you want to chenge the jssdk dependency link resources.
  // ZoomMtg.setZoomJSLib('https://dmogdx0jrul3u.cloudfront.net/1.4.2/lib', '/av'); // CDN version default
  // ZoomMtg.setZoomJSLib('http://localhost:9999/node_modules/zoomus-jssdk/dist/lib', '/av'); // Local version default

  ZoomMtg.preLoadWasm();

  ZoomMtg.prepareJssdk();

  var API_KEY = 'YOUR_API_KEY';

  /**
   * NEVER PUT YOUR ACTUAL API SECRET IN CLIENT SIDE CODE, THIS IS JUST FOR QUICK PROTOTYPING
   * The below generateSignature should be done server side as not to expose your api secret in public
   * You can find an eaxmple in here: https://marketplace.zoom.us/docs/sdk/native-sdks/Web-Client-SDK/tutorial/generate-signature
   */
  var API_SECRET = 'YOUR_API_SECRET';

  document.getElementById('join_meeting').addEventListener('click', function(e) {

    e.preventDefault();

    if (!this.form.checkValidity()) {
      alert("Enter Name and Meeting Number");
      return false;
    }

    var meetConfig = {
      apiKey: API_KEY,
      apiSecret: API_SECRET,
      meetingNumber: parseInt(document.getElementById('meeting_number').value),
      userName: document.getElementById('display_name').value,
      passWord: "",
      leaveUrl: "https://zoom.us",
      role: 1
    };


    var signature = ZoomMtg.generateSignature({
      meetingNumber: meetConfig.meetingNumber,
      apiKey: meetConfig.apiKey,
      apiSecret: meetConfig.apiSecret,
      role: meetConfig.role,
      success: function(res) {
        console.log(res.result);
      }
    });

    ZoomMtg.init({
      leaveUrl: 'http://www.zoom.us',
      isSupportAV: true,
      success: function() {
        ZoomMtg.join({
          meetingNumber: meetConfig.meetingNumber,
          userName: meetConfig.userName,
          signature: signature,
          apiKey: meetConfig.apiKey,
          userEmail: 'email@gmail.com',
          passWord: meetConfig.passWord,
          success: function(res) {

			$('#nav-tool').hide();
            console.log('join meeting success');

			// meeting set to record by default
            ZoomMtg.record({
              record: true
            });

			// meeting set to show record button
            // ZoomMtg.showRecordFunction({
            // 	show: true
            // });
          },
          error: function(res) {
            console.log(res);
          }
        });
      },
      error: function(res) {
        console.log(res);
      }
    });

  });

})();

Let me know if this works for you!

Thanks,
Tommy

Hey @tommy

Unfortunately, your code doesn’t seem to work. I used the exact same code you posted.
I am able to join as host as I’m getting the message “You are are host now”. But the recording functionality is missing.
I tried both functions that are related to recording(ZoomMtg.record and ZoomMtg.showRecordFunction) and neither seems to have effect. In the case of ZoomMtg.showRecordFunction the record button doesn’t appear.

Do I need to login first maybe?

Also, its worth mentioning that I’m using the free Basic plan.

1 Like

Hey @tony,

For the recording feature you do need at least the Pro paid plan: https://zoom.us/pricing OR you can reach out to our customer support and ask for the Free Trail if you want to test this out before paying.

After you do that, your code should work :slight_smile:

Thanks for your patience,

Tommy

Hi @tommy

So to test the “recording” feature using WEB SDK need:

  • Free Trial Account
  • Use a supported browser (only crome)
  • run as host user ZoomMtg.record({
    record: true
    });

Where I can find the latest WEB ZOOM SDK docs - I need to clarify If there is an ability to start “recording” in the cloud - only audio (no video, screen sharing).

Thanks!

Hey @frayeralex,

Correct!

To accomplish this, simply have your video turned off.

Here are the Web SDK docs:
https://marketplace.zoom.us/docs/sdk/native-sdks/web

Let me know if you have additional questions! :slight_smile:

Thanks,
Tommy

Hi @tommy
But in my case, our APP needs to record audio-only during video/audio/screen-sharing calls. Is it possible in the current Web SDK to add some extra flag? Something like ZoomMtg.record({
record: true,
formats: [“audio”]
});
Maybe in future versions? Also, will Computer Audio has more browser supports in the future? Now Computer Audio works well only in Chrome((

Thanks a lot!

Hey @frayeralex,

Unfortunately our Web SDK does not support custom recording like that.

We will consider adding this to our roadmap.

Yes, we are working on more browser support next year.

Thanks,
Tommy

hello, @tommy I am using SDK web i just want to ask how can i stop the automatic recording… i want the recording functionality but i don’t want it to be automatic recording each time ill start a meeting… can you assists me on this issue…

Hey @keneth.prospark,

You can turn off automatic recording for specific meetings, or in your user or account settings. You can also change these settings in the Zoom Web Portal.

Or with the Web SDK, while you are in the meeting, you can turn off recording via the record function.

Thanks,
Tommy