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

131
Vistas
Reproduce multiple tracks with ReactAudioPlayer

I succesfully used react-audio-player to reproduce an audio track; now I need to reproduce more than one track, and possibly to reproduce them sequentially (but without autoPlay: I need to start the first one manually and then the following start by themselves). Is it possible to do that?

What I did:

<ReactAudioPlayer
     src="https://www.examplelink1.com/example1.mp3"
     controls
/>

What I need:

<ReactAudioPlayer
     src=["https://www.examplelink1.com/example1.mp3", "https://www.examplelink2.com/example2.mp3"]
     controls
/>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you read the docs the src attribute type is "String", so you can't pass an array.

One simple way could be to create a player component for each track, use the onEnded attribute to catch the current endend track and change te app state consequently.

Your state would have a currentIndex: 0 attribute which is current track's index. When you map your array of tracks you check if the current element'index of the array equals to currentIndex as autoplay attribute value.

Within the onEnded callback you increment the index.

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