Cannot run stream.adjustRenderedVideoPosition right after connecting

When my video client connects and other users are already in the room,
I want to display their camera streams, of course.
If I get more than 1 user, I’ll want to rearrange the video position on canvas.
if there are 2+ streams already running when a new client joins, that new
client will have to run stream.adjustRenderedVideoPosition

However, doing so right after connecting results in an error.
**Only after the console says **
consume interval 3
does it work.
Is there a way for me to detect that?

Browser Console Error
here is the error that’s caught attempting to run stream.adjustRenderedVideoPosition

reason: "userId is not correct"

The thing is, after the console says

js_media.min.js:1 sharing decode fileURL: http://localhost:8081/public/zoomlib/sharing_mtsimd.min.js
ready to start!
ready to start!
ready to dec video!
ready to dec video!
JsAudioDec.js receive startMedia
JsAudioDec.js receive startMedia
consume interval 3

the same code runs without problems.

Which Web Video SDK version?

Video SDK Code Snippets
The code snippets that are causing the error / issue so we can reproduce.
(running VueJS)

            initClient() {
                this.client = ZoomVideo.createClient();
                this.client.init('en-US', window.location.origin + '/public/zoomlib');
                let signature = await this.fetchToken();

                this.client.join(this.topic, signature, this.username, this.password)
                .then( async (data) => {
                    // this.addClientEventHandlers();
           = this.client.getMediaStream();
           = this.client.getChatClient();
           = this.client.getSessionInfo();

                .catch((error) => {


from here: client.on(‘user-updated’)
if new user to render > start render
right after render, I call stream.adjustRenderedVideoPosition
with the correct coordinates

To Reproduce(If applicable)

If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

  • Device: Mac Mini, PC, Macbook, other PC
  • OS: MacOS11, Windows 10
  • Browser: Chrome
  • Browser Version 95

Additional context
Add any other context about the problem here.

Hey @simkin

Thanks for your feedback.

stream.adjustRenderedVideoPosition should be invoked after the video is rendered, when joining a session, the VideoSDK will establish multiple data channels (audio, video, sharing) with the server, it may take a while, so even invoking stream.renderVideo right after the connecting, in VideoSDK, it will be held until the data channel connection is established. We provide the media-sdk-change event to indicate the accurate timing of initialization.

In the sample project, here are the usage of the media-sdk-change event, sample-app-videosdk/App.tsx at master · zoom/sample-app-videosdk · GitHub and sample-app-videosdk/useRenderVideo.ts at master · zoom/sample-app-videosdk · GitHub

Hope my explanation can help you.


1 Like

Vic thank you that was exactly what I needed.
I imagine I am not the only one who needed this bit of info, so it would
be very helpful if the SDK reference could be updated with all the
events available.

Thank you again.

Great to hear @simkin !

We will add this to the SDK reference CC @vic.yang .


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