# Desktop SDK: CreateVideoElement and meeting state

**URL:** <https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611>\
**Category:** Meeting SDK\
**Created:** [April 30, 2020, 5:37pm UTC](https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611 "2020-04-30T17:37:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [April 30, 2020, 5:37pm UTC](https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611/1 "2020-04-30T17:37:53Z")

</div>

I am trying to understand why sometimes CreateVideoElement fails returning null. Sadly the C# wrapper does not return the failure reason. It seems to be related to the video state, but It would be useful to be able to create a video element before joining a meeting. Is it documented anywhere?  
Thanks!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [May 2, 2020, 6:38am UTC](https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611/2 "2020-05-02T06:38:44Z")

</div>

Hi [bragma](https://devforum.zoom.us/u/bragma),

Thanks for the post. For the implementation of Custom UI, you may refer to the doc here: [https://marketplace.zoom.us/docs/sdk/native-sdks/windows/mastering-sdk/custom-ui-feature](https://marketplace.zoom.us/docs/sdk/native-sdks/windows/mastering-sdk/custom-ui-feature) or the custom UI implementation in our Windows SDK demo app(sdk\_demo\_v2). However, it sounds like you are facing some issues that are documented. I think the CreateVideoElement will return an SDK error in [https://github.com/zoom/zoom-c-sharp-wrapper/blob/5500fbaac55b10068f1f05b166755048a8ca2034/zoom\_sdk\_c\_sharp\_wrap/customized\_video\_container\_dotnet\_wrap.h#L64](https://github.com/zoom/zoom-c-sharp-wrapper/blob/5500fbaac55b10068f1f05b166755048a8ca2034/zoom_sdk_c_sharp_wrap/customized_video_container_dotnet_wrap.h#L64), you could try to print it out and see why it is not working.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [May 2, 2020, 8:23am UTC](https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611/3 "2020-05-02T08:23:02Z")

</div>

Hi Carson, I was aware I should wait for MEETING\_STATUS\_CONNECTING, but in fact it seems creating video element requires MEETING\_STATUS\_INMEETING instead. I was expecting for type PREVIEW to be available when connecting. In any case, it seems all video element creations fail when not inmeeting.  
I am having some hard time printing out the exact error value, since I cannot place breakpoints in there (values are inaccessible due to optimization even if I disable code optimization) and I am not sure what to use to print out the value.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [May 7, 2020, 5:22am UTC](https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611/4 "2020-05-07T05:22:09Z")

</div>

Hi [bragma](https://devforum.zoom.us/u/bragma),

The C# wrapper allows you to modify and to rebuild at any time so you may configure it to help your debug process.

Here are the steps that could be helpful for your case:

1. After successfully created the video container, you could create and use a preview video element after receiving MEETING\_STATUS\_CONNECTING.
2. The active and normal video element needs to be created and be used only after the status is MEETING\_STATUS\_INMEETING

If any of the steps are not a success, the corresponding interface will return the error code that shows the root cause of why it is not working as expected.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 9:06pm UTC](https://devforum.zoom.us/t/desktop-sdk-createvideoelement-and-meeting-state/15611/5 "2020-08-21T21:06:07Z")

</div>

Closed on August 21, 2020, 9:06pm UTC


