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

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.

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