# Issue with createLocalVideoTrack and start method not awaiting or returning properly when using virtual background in Zoom Video SDK

**URL:** <https://devforum.zoom.us/t/issue-with-createlocalvideotrack-and-start-method-not-awaiting-or-returning-properly-when-using-virtual-background-in-zoom-video-sdk/119976>\
**Category:** Video SDK\
**Created:** [October 29, 2024, 5:44am UTC](https://devforum.zoom.us/t/issue-with-createlocalvideotrack-and-start-method-not-awaiting-or-returning-properly-when-using-virtual-background-in-zoom-video-sdk/119976 "2024-10-29T05:44:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oganyan](https://avatars.discourse-cdn.com/v4/letter/o/6a8cbe/32.png) [@oganyan](https://devforum.zoom.us/u/oganyan)\
**Post date:** [October 29, 2024, 5:44am UTC](https://devforum.zoom.us/t/issue-with-createlocalvideotrack-and-start-method-not-awaiting-or-returning-properly-when-using-virtual-background-in-zoom-video-sdk/119976/1 "2024-10-29T05:44:20Z")

</div>

**Video SDK Type and Version**  
JS v1.12.10

**Description**  
I encountered an issue while using Zoom Video SDK, but this problem only occurs when using a virtual background. Here’s the code:

```js
const localVideoTrack = ZoomVideo.createLocalVideoTrack();
await localVideoTrack.start(canvas, { imageUrl: 'blur' });

```

It seems that the start method is not awaiting or returning properly when a virtual background is applied, causing issues with ensuring the start process is complete before moving on to the next line of code. Has anyone else experienced this, or is there a recommended workaround to handle this scenario? Any help would be appreciated!

**The following is part of the Video SDK’s internal code:**

```js
async start(e, t) {
  ...
    else {
      if (!(e instanceof HTMLCanvasElement))
        throw new Error("Cannot start video with virtual background");
      this.localPreview // <-- not awaiting or not returning
        .setup()
        .then(() =>
          this.localPreview.startPreview(e, { ...t, deviceId: this.deviceId })
        )
        .then(() => {
          this.vbPreviewInProgress = !0;
        });
    }
}

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [October 29, 2024, 9:49am UTC](https://devforum.zoom.us/t/issue-with-createlocalvideotrack-and-start-method-not-awaiting-or-returning-properly-when-using-virtual-background-in-zoom-video-sdk/119976/2 "2024-10-29T09:49:12Z")

</div>

Hey @oganyan

Thanks for your feedback.

We will fix this issue in the upcoming release. (Around Nov 4th)

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![oganyan](https://avatars.discourse-cdn.com/v4/letter/o/6a8cbe/32.png) [@oganyan](https://devforum.zoom.us/u/oganyan)\
**Post date:** [January 16, 2025, 6:14am UTC](https://devforum.zoom.us/t/issue-with-createlocalvideotrack-and-start-method-not-awaiting-or-returning-properly-when-using-virtual-background-in-zoom-video-sdk/119976/3 "2025-01-16T06:14:01Z")

</div>

Hi @vic.yang

Thank you for your response.  
I checked the latest SDK, but it seems that the issue has not been fixed.

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [January 16, 2025, 8:36am UTC](https://devforum.zoom.us/t/issue-with-createlocalvideotrack-and-start-method-not-awaiting-or-returning-properly-when-using-virtual-background-in-zoom-video-sdk/119976/5 "2025-01-16T08:36:25Z")

</div>

Hey @oganyan

I apologize for the mistake; I will fix it in the upcoming release.

Thanks  
Vic
