# Need to run a custom function

**URL:** <https://devforum.zoom.us/t/need-to-run-a-custom-function/68362>\
**Category:** Web\
**Tags:** webinar\
**Created:** [April 30, 2022, 12:25pm UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362 "2022-04-30T12:25:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [April 30, 2022, 12:25pm UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362/1 "2022-04-30T12:25:11Z")

</div>

**Description**  
When an attendee is joining a webinar before the host has joined,  
component shows a “meeting not started” message and keeps on loading till the host joins

UseCase  
in my case, we take the user to a particular room and then start a zoom meeting because of which  
when this case happens , and the attendee uses the leave button on the UI,  
we don’t have any trigger to take him out

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/5/6/563d34e8bfc24a1f29ea8cbd9c6f6c4429307a83.png)

Fix needed  
for leaving and Ending meeting, we have client.leaveMeeting and client.endMeeting  
functions, however since the meeting is not joined in this case ,I cant use those to manually trigger zoom meeting exit

how can I stop zoom at this point  
it would be helpful either if I can get a trigger on click of the leave button or  
if u can help me with which function to run to end this session completely using a self-designed overlay leave UI

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [May 6, 2022, 12:20am UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362/2 "2022-05-06T00:20:37Z")

</div>

Hi, @Zerodistance,

Thank you for posting in the Developer Forum. Good question! Before diving in, can you help me understand the use case a bit more? If you can provide the following information, that will help us figure out the best way forward:

1. How do you currently manage the problem that you are looking to solve?

2. What is the most challenging or inconvenient thing about your current solution to the problem?

3. How much time do you currently spend on this problem, and how much time would you ideally  
spend on it with the help of a trigger on click of the leave button?

That aside, I think you raise a good point that there is no way to take users out when the meeting has not started-- especially in the case where it will start for hours down the road. An alternative workflow you can consider is listening to [webinar.participant\_joined](https://marketplace.zoom.us/docs/api-reference/zoom-api/events#/paths/webinar.participant_joined/post) webhook, then triggering a page refresh to exit if the meeting has not started.

Let us know your thoughts on the above.

Best,  
Donte

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [May 6, 2022, 4:50am UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362/3 "2022-05-06T04:50:43Z")

</div>

Hello @donte.zoom

1. Currently I’m using the promise resolve by the client.join function to catch error code 3008 to raise a popup asking the user to wait there or exit the page  
exiting the page triggers reload

2)implementing the popup didn’t take much time, but since as i mentioned earlier exit triggers reload  
it’s a bad experience, our website is a SPA, on every reload it runs an intro video and the user has to repeat many steps to reach meeting listings to join another one which makes reload option less feasible

3)if you can gimme a custom function, I can just take them to the homepage, which makes everything cool, or another option is to make the end meet work for this case too,

currently, the end meeting removes participants from said meeting and terminates all zoom related activity I presume  
for my case, it just has to terminate all zoom related activity, if u can get this done, I can trigger the end meeting instead of reloading

please look into this

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [May 9, 2022, 6:35pm UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362/4 "2022-05-09T18:35:32Z")

</div>

Hey @Zerodistance ,

Have you considered using our Webhook events or APIs?

You could do a check to see if the Webinar has started before spinning up the SDK.

Get Webinar Status Webhook: [Zoom Meeting API](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods#operation/dashboardWebinarDetail)

Webinar Started Webhook: [Zoom API Events - Meeting](https://marketplace.zoom.us/docs/api-reference/zoom-api/events#/paths/webinar.started/post)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [May 11, 2022, 9:50am UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362/5 "2022-05-11T09:50:18Z")

</div>

hello @tommy

ill be sure to look into this

can u please help me with this

> [@leaveUrl on Component View](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/12):
>
> Based on the error, it looks like another action is being executed when the meeting is in a closing state. Can you share the exact actions made when that error occurs? Perhaps you could implement asynchronous logic to properly manage your application’s flow.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 10, 2022, 7:50pm UTC](https://devforum.zoom.us/t/need-to-run-a-custom-function/68362/6 "2022-06-10T19:50:42Z")

</div>

Closed on June 10, 2022, 7:50pm UTC

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