# Zoom throws error when starting video if you're alone in a meeting

**URL:** <https://devforum.zoom.us/t/zoom-throws-error-when-starting-video-if-youre-alone-in-a-meeting/107036>\
**Category:** Web\
**Created:** [April 2, 2024, 8:00pm UTC](https://devforum.zoom.us/t/zoom-throws-error-when-starting-video-if-youre-alone-in-a-meeting/107036 "2024-04-02T20:00:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thoffart](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/thoffart/32/53203_2.png) [@thoffart](https://devforum.zoom.us/u/thoffart)\
**Post date:** [April 2, 2024, 8:00pm UTC](https://devforum.zoom.us/t/zoom-throws-error-when-starting-video-if-youre-alone-in-a-meeting/107036/1 "2024-04-02T20:00:33Z")

</div>

**Description**  
Zoom throws an error when starting the video if you’re alone in the Meeting.

The issue seems related with this line:

```auto
 "string" == typeof r.canvas && (r.canvas = document.getElementById(r.canvas))

```

Where r.canvas will be `main-video`.

as I’m alone at the meeting, it will not exist a document with the id `main-video`. Checking the DOM tree I can only find a video with the id `"main-video-self`.

the code breaks when Zoom tries to access the id of the r.canvas later in the code.

```auto
 W = r.canvas.id

```

the issue doesn’t happen if there is another participant in the meeting.

**Browser Console Error**

```auto
js_media.min.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'id')
    at e.<anonymous> (js_media.min.js:1:604276)
    at p (js_media.min.js:1:103944)
    at Generator.<anonymous> (js_media.min.js:1:105281)
    at Generator.next (js_media.min.js:1:104307)
    at r (js_media.min.js:1:64601)
    at s (js_media.min.js:1:64812)
    at js_media.min.js:1:64871
    at new Promise (<anonymous>)
    at e.<anonymous> (js_media.min.js:1:64752)
    at e.Notify_MeidaSDK (js_media.min.js:1:653595)

```

**Which Web Meeting SDK version?**  
3.1.2 and 3.5.2

**Meeting SDK Code Snippets**

```auto
  const onSuccessZoomInit = useCallback(
    (
        meetingConfig: {
          meetingNumber: string | number
          userName: string
          userEmail?: string
          passWord?: string
          customerKey?: string
          tk?: string
          zak?: string
          sdkKey?: string
          signature: string
          recordingToken?: string
        },
        launchInBrowserURL: string,
        ZoomMtg: ZoomMtgType,
      ) =>
      () => {
        initZoomStatus.current = true
        ZoomMtg.join({
          ...meetingConfig,
          success: onZoomJoinSuccess(ZoomMtg),
          error: (error: unknown) => handleZoomError(error, launchInBrowserURL),
        })
      },
    [handleZoomError, onZoomJoinSuccess],
  )

const meetingConfig = {
          sdkKey,
          signature,
          meetingNumber: meetingId,
          userName,
          passWord: pwd ? pwd : '',
          zak: zak,
        }

        ZoomMtg.init({
          leaveUrl: leaveUrl,
          isSupportAV: true,
          disablePreview: !user,
          success: onSuccessZoomInit(meetingConfig, launchInBrowserURL, ZoomMtg),
          error: (error: unknown) => handleZoomError(error, launchInBrowserURL),
        })

```

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Create a meeting
2. make sure that you’re the only participant
3. start video
4. See error

- Device: Macbook Pro
- OS: MacOS 14.4.1
- Browser: Chrome
- Browser Version 123.0.6312.87 (Official Build) (arm64)

---

<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:** [April 12, 2024, 12:01pm UTC](https://devforum.zoom.us/t/zoom-throws-error-when-starting-video-if-youre-alone-in-a-meeting/107036/2 "2024-04-12T12:01:26Z")

</div>

@thoffart ,

Thank you for sharing your post. I’ve done some testing on the latest sample App , but I’m unable to replicate the behavior you’ve reported. As a next step, you can try using the sample app and let us know if you’re encountering the same issue.

---

<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:** [May 12, 2024, 10:01pm UTC](https://devforum.zoom.us/t/zoom-throws-error-when-starting-video-if-youre-alone-in-a-meeting/107036/3 "2024-05-12T22:01:58Z")

</div>

Closed on May 12, 2024, 10:01pm UTC

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