Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!