Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda