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

319
Vistas
How to send sound notification in react whenever data change?

I've been working on a chat App I want to play a sound whenever my data changes.

useEffect(()=>{
   window.scrollTo(0,document.body.scrollHeight)
   var notifyAudio = new Audio('../../public/Files.Notify.wav')
   notifyAudio.loop = false
   notifyAudio.play()
 },[messages])

But, I end up with this error
"Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first"

How I can get this type of functionality in my app?

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

0

This React Library allows us to autoplay sound and it's working fine. https://github.com/joshwcomeau/use-sound

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