Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda