# Camera don’t starts and we get the error - {type: 'INVALID\_OPERATION', reason: 'Camera is starting,please wait.'}

**URL:** <https://devforum.zoom.us/t/camera-don-t-starts-and-we-get-the-error-type-invalid-operation-reason-camera-is-starting-please-wait/93462>\
**Category:** Web\
**Created:** [August 16, 2023, 7:45am UTC](https://devforum.zoom.us/t/camera-don-t-starts-and-we-get-the-error-type-invalid-operation-reason-camera-is-starting-please-wait/93462 "2023-08-16T07:45:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatumistudio](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@tatumistudio](https://devforum.zoom.us/u/tatumistudio)\
**Post date:** [August 16, 2023, 7:45am UTC](https://devforum.zoom.us/t/camera-don-t-starts-and-we-get-the-error-type-invalid-operation-reason-camera-is-starting-please-wait/93462/1 "2023-08-16T07:45:17Z")

</div>

**Description**  
Thanks for the nice SDK.  
After successful Client.join, we try to start the camera. But we get the error.  
The screen does not work after waiting.

I would appreciate it if you could tell me the cause of the error and how to solve it.

**Browser Console Error**  
`{type: 'INVALID_OPERATION', reason: 'Camera is starting, please wait.'}`

**Which Web Video SDK version?**  
ver.1.8.5

**Device**

- Device: Macbook Pro
- OS: macOs Ventura: ver. 13.2 (22D49)
- Browser: google chrome: ver.115.0.5790.170 (Official Build) (arm64)
- Camera Model: Built-in Mac camera

**Environment**

- Next.js: ver.13
- Nest.js: ver.7

**Video SDK Code Snippets**

```auto
function Meeting() {
    useEffect(()=> {
        const fetch = async () => {
            const VideoSDK=await (await import('@zoom/videosdk')).default;

            let payload = router.query;
            payload.password = 'dip123';

            const {data} = await axios({
                url: 'api/zoom',
                method: 'post',
                data:payload,
            }).then((response)=>{
                return response;
            }).catch((error) => {
                return error;
            })

            let client = VideoSDK.createClient();
            client.init('en-US');

            let selfView=document.getElementById('self-view');
            let participantC = document.getElementById('participant-c');
     client.join(payload.topic,data.sessionToken,payload.username,payload.password).then(response=>{
                let stream = client.getMediaStream();

                stream.startVideo({
                    videoElement:selfView
                }).then(response=>{
                    stream.renderVideo(selfView, client.getCurrentUserInfo().userId, 540, 540).then(response=>{
                        console.log('-- current user is joined --> ', client.getCurrentUserInfo().userId);
                    }).catch(error=>{
                        console.log('-- self view renderer error -> ', error);
                    })

                    client.getAllUser().forEach(user=>{
                        stream.renderVideo(participantC,user.userId,540,540,0,0,2).then(response=>{
                            console.log('-- user joined -->' ,payload[0].user);
                        }).catch(error=>{
                            console.log('-- error while user-added video renderer -->' ,error);
                        })
                    })
                    BindEvents(stream);
                }).catch(error=>{
                    console.log('-- start video error --> ', error);
                })

                function BindEvents(stream) {
                    client.on('user-added',(payload)=>{
                        stream.renderVideo(participantC,payload[0].userId,540,540,0,0,2).then(response=>{
                            console.log('-- user joined -->', payload[0].user);
                        }).catch(error=>{
                            console.log('-- error while user-added video rendered --> ', error);
                        })
                    })
                }

                console.log(stream, "stream");

            }).catch(error=>{
                console.log('-- error while joining -->', error);
            })

        }
        fetch();
    },[]);

    return (<Fragment>
        <div id="room" className={ZoomStyles.room}>
            <video id={'self-view'} className={ZoomStyles.selfView}></video>
            <canvas id={'participant-c'} className={ZoomStyles.participantsC}></canvas>
        </div>
    </Fragment>);
}

Meeting.displayName='Meeting';
export default Meeting;

```

**Additional context**  
The response after Client.join is as follows.

```auto
{
"audioConnectionStatus":0,
"bAllowISORecord":false,
"bCCEditor":false,
"bCanPinMultiVideo":false,
"bCapsPinMultiVideo":false,
"isRequestLT":false,
"isGuest":false,
"bHold":false,
"bMultiStreamVideoUser":false,
"bNDIBroadcast":false,
"bPrivateChatMsgDisabled":false,
"bRaiseHand":false,
"canRecord":0,
"caps":1310976,
"displayName":"dip",
"userId":16780288,
"nSkinTone":1,
"os":7,
"userRole":0,"
isHost":false,
"strConfUserID":"38MUO3PuQkyrcRNuSgqtwQ",
"userType":9,
"uniqueIndex":1,
"uniqueUserID":3,
"userGUID":"CCC63D81-F00D-C92F-890F-46BCCE4EE645",
"zoomID":"zMY9gfANyS-JD0a8zk7mRQ",
"action":2,
"audio":"",
"bAudioUnencrytped":false,
"muted":false,
"nFECC":0,
"nFECCExecutive":16780290,
"bVideoConnect":true,
"bVideoOn":false
} 

```

---

<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:** [August 16, 2023, 10:23am UTC](https://devforum.zoom.us/t/camera-don-t-starts-and-we-get-the-error-type-invalid-operation-reason-camera-is-starting-please-wait/93462/2 "2023-08-16T10:23:39Z")

</div>

Hey @tatumistudio

Thanks for your feedback.

It will take a little longer when starting the video for the first time, the start time depends on the camera model.

We recommend waiting for the `stream.startVideo` method to get resolved before calling it again. Otherwise, the “{type: ‘INVALID\_OPERATION’, reason: ‘Camera is starting, please wait.’}” error occurs.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![tatumistudio](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@tatumistudio](https://devforum.zoom.us/u/tatumistudio)\
**Post date:** [August 17, 2023, 1:05am UTC](https://devforum.zoom.us/t/camera-don-t-starts-and-we-get-the-error-type-invalid-operation-reason-camera-is-starting-please-wait/93462/3 "2023-08-17T01:05:35Z")

</div>

Hi @vic.yang

Thanks for your help!

I will try it.  
If that doesn’t solve the problem, I’ll ask again.

---

<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:** [September 16, 2023, 11:05am UTC](https://devforum.zoom.us/t/camera-don-t-starts-and-we-get-the-error-type-invalid-operation-reason-camera-is-starting-please-wait/93462/4 "2023-09-16T11:05:47Z")

</div>

Closed on September 16, 2023, 11:05am UTC

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