Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
ZegoExpressManager joinRoom - Parameter is Array Type

I'm noob and need your Help

i have this Function here:

async function joinRoom() {
      const tokenObj = await generateToken();
      await ZegoExpressManager.shared.joinRoom(config.roomID, tokenObj.token, {
        userID: config.userID,
        userName: config.userName,
        
      });

I need now to Set the last Parameter to this:

[ZegoMediaOptions.AutoPlayAudio, ZegoMediaOptions.PublishLocalAudio]

This is what i tried:

async function joinRoom() {
      const tokenObj = await generateToken();
      await ZegoExpressManager.shared.joinRoom(config.roomID, tokenObj.token, {
        userID: config.userID,
        userName: config.userName,
        AutoPlayAudio: 1,
        PublishLocalAudio: 4, 
        
      });

And it not works... The support of the API told me: The Last Parameter is an ArrayType

Please teach me ))

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Why don't you look at the TypeScript definition of joinRoom function:

joinRoom(
    roomID: string,
    token: string,
    user: ZegoUser,
    options?: ZegoMediaOptions[]
  ): Promise<boolean>

You can conclude that:

  • joinRoom takes 4 arguments
  • options argument is optional (you don't need to specify it)
  • options takes an array

I never used the API, but my attempt would be:

await ZegoExpressManager.shared.joinRoom(
  config.roomID, 
  tokenObj.token, 
  {
    userID: config.userID,
    userName: config.userName
  },
  [ZegoMediaOptions.AutoPlayAudio, ZegoMediaOptions.PublishLocalAudio]
);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!