DestroyAllVideoElement() crashes my app when meeting is stopped from API

Hi, in my app I create several video containers and video elements within them. When the meeting enters “MEETING_STATUS_DISCONNECTING” state, I destroy all my elements in this order:

  1. I call DestroyAllVideoElement() to remove all elements within a container
  2. I call DestroyVideoContainer() on all containers

This works well when I end the meeting with the SDK call to Leave().

If I instead I end the meeting with an API call to “DELETE /meetings/{meetingId}” I receive a “MEETING_STATUS_DISCONNECTING” state notification, and as explained above I call “DestroyAllVideoElement()”. This freezes my app and causes an exception.

Apart from signaling the bug, I have a question:

  • If I want to destroy the container do I need to destroy all elements before or can I directly destroy the container without causing leaks/problems?

Thanks!

Hi @bragma,

Thanks for the post. The DestroyAllVideoElement() only deletes the corresponding objects inside our SDK, it won’t cause app freeze. Please note that: using DestroyVideoContainer() will not trigger DestroyAllVideoElement() so you will need to call them separately. If any of them is missing, then it could cause issues.

Hope this helps. Thanks!

Ok thanks @Carson_Chen, so I need to understand how to make the call to “DestroyAllVideoElement()” work. As said, the call works when the meeting is terminated with a call to Leave(). It instead does not work when the meeting is terminated by a call to the Zoom API.

Hi @bragma,

Thanks for the reply. Please try not to use Zoom API to end/delete Zoom meetings when using Zoom SDK. If you would like to delete a meeting, please end the meeting using Zoom SDK, and then you could call the Zoom API to delete the meeting.

Hope this helps. Thanks!

Hi @Carson_Chen,
I’m not sure I can do what I need using just the SDK. I want to stop “unused” sessions from my back-end. This cover several cases, ex: the service administrator wants to terminate a meeting (but he’s not a host), the meeting exceeded the time we want to allow, etc. In this case, I use this API endpoint:

PUT /meetings/{meetingId}/status <-- end

I think this is the exact scope the API has been created for…
In any case I think it should behave well with people in meeting using the SDK.

Hi @bragma,

Thanks for the reply. For the use case you are mentioning, such as the admin would like to end the meeting remotely or the meeting exceeded the allowed time, you could have a try to have a listener listening to a call from your backend. Once the callback is triggered and the current user is a host, call the leave meeting interface to end the meeting.

Hope this helps. Thanks!

Ok, but it is a bit more complex have a mobile app listen for an event from API. It’s not impossible but requires some more infrastructure and have no guarantee that the mobile app will actually receive the message. Ex: the app crashed, is suspended, etc.

Understand. Thanks for sharing this. However, using the API to terminate a meeting is not recommended since they are not designed to be used in this way. So we cannot guarantee results and there might be issues happening such as the one you are mentioning in this topic.

Thanks!

I do not want to make this longer than needed, but I think there is a specific API endpoint for terminating a training:

The status can only be set to “end” and this terminates a meeting. What’s its correct use case than if not to end a meeting? It seems to be its only purpose. Also you cannot know reliably how many people are still in.

Thanks!

Hey @bragma,

Yes, the Update Meeting Status API will end a live Zoom meeting.

Thanks,
Tommy

Hi @tommy, thanks for answering. Given that the purpose of that API call is to end a running meeting, the fact that is causes clients connected with Windows SDK to misbehave as described above can be considered a bug of the SDK? I think so…

Hey @bragma,

In your original post, you mentioned using the Delete Meeting API.

Just so we are on the same page, does the Update Meeting Status (End Meeting API) cause the errors too?

Thanks,
Tommy

@tommy I have to beg your pardon. I re-read my first post and noticed the error. In my backend code, first I call the “Update Meeting Status (End Meeting)” then the “Delete Meeting” (for scheduled meetings that will not be automatically deleted).