How can i use leave meeting callBack use for Component view in react

Description
I have implemented web sdk 4.0.0 Component View into react.
React version is "react": "^17.0.1",
When i click on the Leave meeting button then i want to use some extra functionality. So, anyone can guide me how can i use leave meeting callback for component view.

Browser Console Error

Which Web Meeting SDK version?
2.4.0

Meeting SDK Code Snippets
let meetingSDKElement = document.getElementById(‘meetingSDKElement’);

client.init({
  // debug: true,
  zoomAppRoot: meetingSDKElement,
  language: 'en-US',
  customize: {
    // chat: {
    //   popper: {
    //     disableDraggable: false,
    //     // anchorElement: meetingSDKChatElement,
    //     placement: 'left'
    //   }
    // },
    meetingInfo: [
      'topic',
      'host',
      'mn',
      'pwd',
      'telPwd',
      'invite',
      'participant',
      'dc',
      'enctype',
    ],
    toolbar: {
      buttons: [
        {
          text: 'Custom Button',
          className: 'CustomButton',
          onClick: () => {
            console.log('custom button');
          },
        },
      ],
    },
    video: {
      isResizable: false,
    }
  },
}).then((e) => {
  console.log('init success', e);
}).catch((e) => {
  console.log('init error', e);
});;


ZoomMtg.generateSignature({
  meetingNumber: meetConfig.meetingNumber,
  apiKey: meetConfig.apiKey,
  apiSecret: apiKeys.apiSecret,
  role: meetConfig.role,
  
  success: function (res) {
    // console.log('res', res);

    client
      .join({
        apiKey: meetConfig.apiKey,
        signature: res.result,
        meetingNumber: meetConfig.meetingNumber,
        password: meetConfig.passWord,
        userName: meetConfig.userName,
      })
      .then((e) => {
        console.log('join success', e);

        var user = client.getCurrentUser({});
        // console.log('user: ', user);

        var getAttendeeslist = client.getAttendeeslist({});
        // console.log("getAttendeeslist",getAttendeeslist)

        // client.leaveMeeting().then((e)=>{
        //   console.log("levaeeee then", e);
        // })
        // .catch((e) => {
        //   console.log('levaeeee catch' , e);
        // });

      })
      .catch((e) => {
        console.log('join error', e);
      });
  },
});

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Screenshots

Device (please complete the following information):

  • Device: [e.g. Macbook Pro]
  • OS: [e.g. macOS 11]
  • Browser: [e.g. Chrome]
  • Browser Version [Version 101.0.4951.41 (Official Build) (arm64)]

Additional context
Add any other context about the problem here.

Hi, @ijazalijutt93,

Thank you for posting in the Developer Forum. Before diving in, can you share more details about the additional functionality you are looking to implement with the leave meeting callback? For reference, here is our Component View leave meeting:

  • You can see in my code snippet i am using this callback. but when i click on the Leave Meeting button it is nothing doing anything and console is also empty.
  • Please check i am using inside the join function. I have also tired from outside the join.
  • And it is showing this message You need go to setting enable CC & LT feature once i click on leave meeting button.
client
          .join({
            apiKey: meetConfig.apiKey,
            signature: res.result,
            meetingNumber: meetConfig.meetingNumber,
            password: meetConfig.passWord,
            userName: meetConfig.userName,
          })
          .then((e) => {
            console.log('join success', e);

            var user = client.getCurrentUser({});
            // console.log('user: ', user);

            var getAttendeeslist = client.getAttendeeslist({});
            // console.log("getAttendeeslist",getAttendeeslist)

            // client.leaveMeeting().then((e)=>{
            //   console.log("levaeeee then", e);
            // })
            // .catch((e) => {
            //   console.log('levaeeee catch' , e);
            // });

          })
          .catch((e) => {
            console.log('join error', e);
          });

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.