I can’t seem to figure out how to open an mp3 File on my Webserver.
If I just href the Song (Code below) it opens it on the Client I am accessing it from.
I want the Song to play on the Webserver even if I access the html page from another Device.
<!DOCTYPE html>
<html>
<body>
<a href="Song.mp3">Song</a>
</body>
</html>
How do I solve this?
I am using a Raspberry Pie, Apache, VLC (to play mp3)
Thanks for your support 😀
2
Answers
Because I couldn't execute the command directly I had to create a script which reacts to created files.
Song.sh :
Try this:
index.html:
<a href="/script.php">Song</a>
script.php:
<?php
exec('export DISPLAY=:0; cvlc songs/Song1.mp3');
?>
Edit:
Solution with
inotifywait
which can be CPU consumption friendly:Php:
Bash: