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

178
Vistas
How to change the source of an audio tag with a file anywhere in my computer

Currently I'm working on a project and I'm new to eclipse and server stuff.

I'm doing a Dynamic Web Project of a music player. What I'm trying to do is to change the current song playing for another one in a given directory for Example:

I have a Library of music in my computer: /home/user/Music/Library

And inside of Library there are my songs, what I'm trying to do is change the source of my audio tag with the path of the song I want:

<audio id="audioPlayer">
    <source id = "source" src="/Songs/song1" type="audio/mpeg">
</audio>
<script>
    document.getElementById("source").src = "/home/user/Music/Library/song1.mp3";
    document.getElementById("audioPlayer").load();
</script>

When I run this it throws and error 404 (Not Found).

I have an idea of the problem, maybe the server is running into a specific path and the directory doesn't exist there.

I don't want to add the songs into the project, I want the user to specify the path of the library of music.

I am using Apache-Tomcat 8.0 on Ubuntu 18.04.

over 4 years ago · Santiago Trujillo
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