OPERATION_TIMEOUT on await Stream.startAudio()

Hi,

Can I ask help on this matter please? I always got OPERATION_TIMEOUT when calling Stream.startAudio(). By the way I am using Zoom Video SDK version 1.7.7 and Google Chrome Version 113.0.5672.127 (Official Build) (64-bit).

Here is how I do it:

Function to join zoom session meeting:
Note: This joinSessionMeeting is triggerred when we click a button from the DOM.

async joinSessionMeeting(sessionMeetingID : string) { 
  await this.zoomClient.join(
    this.currentSession.topic,
    session_token,
    this.self.fullname,
    this.currentSession.password
  ).then(() => {

    /* SOME CODES HERE */

    this.zoomStream = this.zoomClient.getMediaStream();
    this.zoomCmd = this.zoomClient.getCommandClient();

    /* SOME CODES HERE */

  }).catch((error) => {
    console.log(error);
  });

  // Initializes Zoom Client Event Listenrs like on user-added
  await this.initClientEventListeners();

  // start audio and make sure to unmute it
  await this.startAudio();

  await this.switchMicSpeaker();
}

Function to start zoom stream Audio:

async startAudio() {
    
  await this.zoomStream.startAudio();

  try {
    if (this.zoomStream.isAudioMuted()) {
      this.zoomStream.unmuteAudio();
      console.log("====AUDIO UNMUTED====");
    }
  } catch (e) {
    console.log(e);
  }      
}

After about 3-6 seconds it wil throw error:

Uncaught (in promise) {type: 'OPERATION_TIMEOUT'}

I did some changes on my startAudio() funtion for testing and just to try recall startAudio when I got that first error. I was hoping during the first run of startAudio my computer audio is busy since the documentation (SDK Reference) states that

OPERATION_TIMEOUT: The operation timed out, try again later.

async startAudio() {
    
  await this.zoomStream.startAudio().then(() => {
    try {
      if (this.zoomStream.isAudioMuted()) {
        this.zoomStream.unmuteAudio();
        console.log("====AUDIO UNMUTED====");
      }
    } catch (e) {
      console.log(e);
    }     
  }).catch(async (error) => {
    const AudioError = error as ExecutedFailure;
    if(AudioError.type === 'OPERATION_TIMEOUT'){
      console.error('=== FORCE to startAduio ===', AudioError);
      await this.startAudio();
    }

  });   
},

But it throws OPERATION_TIMEOUT repeatedly,

Do you have any idea on this please?

Hey @redenfloyd.cayanan

Thanks for your feedback.

We do have OPERATION_TIMEOUT error if the user doesn’t allow the microphone permission within 40 seconds after the permission consent popup appears.

But for 3-6 seconds error, we tested the code you shared above but didn’t reproduce the issue.

Can you check whether the microphone is granted or blocked on the site?

Thanks
Vic

im sure its all related to this issue… with Chrome and permissions… even if its on the Meeting Web SDK…
But im sure its all related… because… its a chrome permissions thing with the SDK… i can put my left nut on it…

1 Like

I am also experiencing the same problem.
I encountered the same issue when running the Video SDK for web sample.
There seems to be an issue with the @zoom1234/videosdk version 1.7.X, but it works fine with version 1.6.X.
In the case of version 1.7.X, there are issues when using it with the latest Firefox and Chrome browsers.However, it works fine when attempting to use it on mobile devices with a mobile browser.
The problem only occurs when using it on PC browsers.
The error occurs consistently after a certain period of time without prompting for microphone permission.

1 Like

@vic.yang I’m sorry about the 3-6 seconds, I tested again an check console timestamps this was the result:
First Log (1st Red Rectangle), was when event listeners where initialize/activated.
Second Log (1st Red Rectangle) , this was when the startAudio returns and OPERATION TIMEOUT

 // Initializes Zoom Client Event Listenrs like on user-added
  await this.initClientEventListeners();![console-timestamp|537x354]

I agree that timeout its about 40 seconds, this was the really problem that I am experiencing.

console-timestamp

Can you check whether the microphone is granted or blocked on the site?
There is a screenshot of my permissions.
microphone-camera-permissions

I agree with @ellis @hicucu as well. I also got those errors/issues they mentioned.

Hoping fo your quick response.

the problem that im getting is… even if you set the permissions in the “Browser” settings… it still not setting the permissions on the app settings itself…

If your app settings is set to Ask every time … the in theory it should take the “Browser” settings into consideration and make them work… BUT… i have found that its not the case… its as if the “Join by Audio” is only setting the Browsers permissions by not the App itselfs permissions…

I dont know if its a SDK thing or the App thing with Chrome…

But by default if this is selected in the App settings itself… it will not work… even if its says “ask every time”

If you say in the APP settings “Allow only while using this app” then it works…

@vic.yang do you have any update about the issue mentioned above? Hoping for your response.

Hey @redenfloyd.cayanan

I reviewed the codes you provided again and found that the audio connected right after the session is joined. It may be related to the audio autoplay policy.

Could you add an event listener for auto-play-audio-failed event?

client.on('auto-play-audio-failed', () => {
  console.log('auto play failed, waiting for a user interaction')
})

Once the user interacts with the page, the audio will be connected automatically.

Thanks
Vic

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