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

185
Vistas
How to handle Audio Mute on a crossplatform agora app?

I have a cross platform agora app. The Mobile version is using the Agora React Native SDK while the web version is using the Web SDK v4. When I was implementing the audio mute / unmute indication I found that the event does not trigger from mobile to web. Can anyone please help me with this, what should I do to make it work?

// This is the Code From React Native 
    const toggleAudio = useCallback(async () => {
    await RtcEngine.instance().enableLocalAudio(!audioEnabled);

    setCurrentUser(prev => {
        return { ...prev, audioEnabled: !audioEnabled }
    })
    setAudioEnabled(!audioEnabled);
}, [audioEnabled]);

And Here is the Web event Handler

 client.on("user-unpublished", (user, type) => {
            if (type === "audio") {
                user.audioTrack?.stop();
                setRemoteUsers(prev => {
                    return prev.map(ussr => ussr.uid == user.uid ? user : ussr);
                })
            }

            if (type == 'video') {
                setRemoteUsers(prev => {
                    return prev.map(ussr => ussr.uid == user.uid ? user : ussr);
                })
            }
        });

The handler works for web to web and also for the video event on mobile but doesn't trigger the callback for the audio

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

On the react-native app use the muteLocalAudioStream method instead.

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