# Can not use function endMeeting/leaveMeeting

**URL:** <https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943>\
**Category:** Web\
**Created:** [February 11, 2023, 3:53pm UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943 "2023-02-11T15:53:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 11, 2023, 3:53pm UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/1 "2023-02-11T15:53:31Z")

</div>

Hi everyone,

- i want to end the meeting when the user closes the tab. I found 2 endMeeting/leaveMeeting functions but I can’t access them. Can you help me with this problem?  
I have tried writing those two functions separately or in zmClient.join but still no success.  
zmClient.join({  
sdkKey: sdkKey,  
signature: signature,  
meetingNumber: meetingNumber,  
userName: userName,  
password: password,  
userEmail: ‘email’,  
success (res) {  
console.log(“join meeting success”);  
console.log(“get attendeelist”);  
ZoomMtg.getAttendeeslist({});  
ZoomMtg.getCurrentUser({  
success: function (res) {  
console.log(“success getCurrentUser”, res.result.currentUser);  
},  
});  
},  
error: function (res) {  
console.log(res);  
},  
})

zmClient.endMeeting({})

Best regards,  
John

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 13, 2023, 2:19am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/2 "2023-02-13T02:19:20Z")

</div>

Hi @tuanthinhit ,

To leave the meeting, you will call the method like this.  
Let me know if it helps

```auto
ZoomMtg.leaveMeeting({
  confirm: false
});

```

> **[ZoomMtg | Zoom Meeting SDK for Web - 2.9.7](https://marketplacefront.zoom.us/sdk/meeting/web/modules/ZoomMtg.html#leaveMeeting)**
>
> Documentation for Zoom Meeting SDK for Web - 2.9.7

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 14, 2023, 3:29pm UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/3 "2023-02-14T15:29:43Z")

</div>

Dear @chunsiong.zoom

Thank you so much, it’s working now.

- But I have a problem. That’s when I exited the room and then re-entered, I couldn’t get back in again. I got this error: Cannot assign to read only property ‘meetingInfo’ of object ‘#’
- Do you have any solution for this problem? As it happens in the init function when I want to customize some information about the zoom.  
Thank you in advance.

Best regards.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/d/3/d3a8daf6dd1696993ad3de7947e50bf6d2635957.png)

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 15, 2023, 2:39am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/4 "2023-02-15T02:39:49Z")

</div>

could you share how you might be customizing the information and how you are calling init?

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 15, 2023, 3:02am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/5 "2023-02-15T03:02:22Z")

</div>

Dear @chunsiong.zoom

- I using this code to init. But when i out room and join room again. Then meetingInfo, toolbar and video will show error read only.
- Please have a look at this problem for me. I am stuck here.
- Thank you in advance.  
Best regards,  
John

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/7/0/70e6e135464178b09ca2502ebe5fd029a29e23c3.png)

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 15, 2023, 3:25am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/6 "2023-02-15T03:25:05Z")

</div>

seems like the accepted strings might be enum, could you change ‘topic22’ to ‘topic’?

> [@MeetingInfoType is undefined with latest WebSdk 1.8.6](https://devforum.zoom.us/t/meetinginfotype-is-undefined-with-latest-websdk-1-8-6/40448/12):
>
> declare enum MeetingInfoType { 'topic' = 'topic', 'host' = 'host', 'mn' = 'mn', 'pwd' = 'pwd', 'telPwd' = 'telPwd', 'invite' = 'invite', 'participant' = 'participant', 'dc' = 'dc', 'enctype' = 'enctype', 'report' = 'report' } can you try modefy MeetingInfoType define and pass typescript type check? [image]

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 15, 2023, 4:04am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/7 "2023-02-15T04:04:47Z")

</div>

Dear @chunsiong.zoom

- same issue, sir
- The problem here seems to be that when exiting the room and running the init function again, it wants to override something in the “customize” properties like meetingInfo, toolbar…

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/d/1dd199049868745237a9b607fa71d1d16b56c0fd.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/4/e442b11576d6636a2dd1dc4b1031c77e0bd9766c.png)

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 15, 2023, 4:56am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/8 "2023-02-15T04:56:50Z")

</div>

@tuanthinhit ,

Everytime you click on join, does it try to re-run init?  
Init should only be called once. Subsequent joins should not call init.

---

<div class="post-metadata">

**Author:** ![thinh.pv](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@thinh.pv](https://devforum.zoom.us/u/thinh.pv)\
**Post date:** [February 15, 2023, 6:36am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/9 "2023-02-15T06:36:52Z")

</div>

Hi @chunsiong.zoom

- But how can I re-initialize the zoom and still keep the value I initially initialized including the size…?  
Thank you.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 15, 2023, 6:56am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/10 "2023-02-15T06:56:08Z")

</div>

Hi @thinh.pv ,

I understand. If that is the case, after you leave the 1st meeting could you do the following?

- [destroyClient()](https://marketplacefront.zoom.us/sdk/meeting/web/components/modules/ZoomMtgEmbedded.html#destroyClient)
- createClient()
- [init()](https://marketplacefront.zoom.us/sdk/meeting/web/components/modules/EmbeddedClient.html#init)

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 15, 2023, 7:28am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/11 "2023-02-15T07:28:44Z")

</div>

Hi @chunsiong.zoom

- I checked and same problem.
- Can you please try and send me your code sample?
- I may have misplaced it so it may not run correct.

Best regards

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 19, 2023, 8:22am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/12 "2023-02-19T08:22:39Z")

</div>

@chunsiong.zoom

- I need to enable SharedBufferArray to enable some functionality like:

- Gallery View on Desktop Chrome, Edge, and Firefox.
- Virtual Background on Chrome and Edge.
- Sending 720p video on Chrome.

Reference link: [https://marketplace.zoom.us/docs/sdk/overview/websdk-gallery-view/](https://marketplace.zoom.us/docs/sdk/overview/websdk-gallery-view/)  
=\> To enable SharedBufferArray, i need to set: Cross-Origin-Embedder-Policy: require-corp Cross-Origin-Opener-Policy: same-origin  
=\> Therefore, currently being blocked from loading scripts when not from the same origin. So some functions like chat from third party can not working.

- Can you help me this issue?

Best regards,  
John

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 20, 2023, 2:45am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/13 "2023-02-20T02:45:45Z")

</div>

Hi John,

Have you there either 3 of these methods?

Implementing Cross-Origin Isolation  
Implementing Credentialless Headers  
Implementing Chrome Origin Trials

They are found here [https://marketplace.zoom.us/docs/sdk/overview/websdk-gallery-view/#implementing-cross-origin-isolation](https://marketplace.zoom.us/docs/sdk/overview/websdk-gallery-view/#implementing-cross-origin-isolation)

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 20, 2023, 2:54pm UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/14 "2023-02-20T14:54:02Z")

</div>

@chunsiong.zoom

- Seem it’s not working well because it’s still block third party script.

Best regards,  
John

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 22, 2023, 3:59am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/15 "2023-02-22T03:59:30Z")

</div>

@tuanthinhit

do you have a screenshot of the console log?

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 25, 2023, 9:59am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/16 "2023-02-25T09:59:38Z")

</div>

Hi @chunsiong.zoom

I have enabled Groupd HD but my web still just show 360p video. Can you help me?  
Do I need to setup the stream function? And if so, where do you need it? Because when I debug, the stream is not defined.  
Link: [https://marketplace.zoom.us/docs/sdk/overview/720p/?fbclid=IwAR084kJgKuKxn7aGd\_IKZ8Q3d-ROE6BZz2kcPHwF6-1vnbMgQcv2oAslPbQ](https://marketplace.zoom.us/docs/sdk/overview/720p/?fbclid=IwAR084kJgKuKxn7aGd_IKZ8Q3d-ROE6BZz2kcPHwF6-1vnbMgQcv2oAslPbQ)  
Thank you in advance.

Best regards.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 27, 2023, 4:12am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/17 "2023-02-27T04:12:36Z")

</div>

@tuanthinhit ,

the page which you are looking at addresses 2 different products  
Video SDK  
Meeting SDK ← do take a look at this section  
I’m adding the [link here](https://marketplace.zoom.us/docs/sdk/overview/720p/?fbclid=IwAR084kJgKuKxn7aGd_IKZ8Q3d-ROE6BZz2kcPHwF6-1vnbMgQcv2oAslPbQ#meeting-sdk-for-web) to make is easier to access

Another thing you want to enable, would be shared array buffer on your browser

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [February 27, 2023, 2:19pm UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/18 "2023-02-27T14:19:38Z")

</div>

Hi @chunsiong.zoom

- Yep. I have enabled SharedArrayBuffer and enabled Group HD but it still not showing 720p video.

Best regards,  
John

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 28, 2023, 2:10am UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/19 "2023-02-28T02:10:00Z")

</div>

are you able to share a screenshot?

---

<div class="post-metadata">

**Author:** ![tuanthinhit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tuanthinhit/32/44109_2.png) [@tuanthinhit](https://devforum.zoom.us/u/tuanthinhit)\
**Post date:** [March 1, 2023, 4:31pm UTC](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943/20 "2023-03-01T16:31:20Z")

</div>

Hi @chunsiong.zoom

- As you can see. I have config as document but my video can not up to 720p.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/8/4/84b102391646126de150b96917feb8b4d4d5b269.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/f/9f8ebb4e4128b22eb1f3e5e458ad535aa516173d.png)

[Next page](https://devforum.zoom.us/t/can-not-use-function-endmeeting-leavemeeting/82943.md?page=2)
