whoami7 - Manager
:
/
home
/
bleuhbh
/
www
/
root
/
public
/
newRadio
/
Upload File:
files >> /home/bleuhbh/www/root/public/newRadio/index.php
<?php $musicDir = "../../../Musique Louis" ; $files = scandir($musicDir); $audioFiles = array_filter($files, function($file) { return preg_match('/\.(mp3|wav|flac)$/i', $file); }); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Music Player</title> <style> body { font-family: sans-serif; padding: 20px; } .track { margin: 10px 0; cursor: pointer; } .track:hover { text-decoration: underline; } </style> </head> <body> <h1>Music Player</h1> <audio id="player" controls autoplay style="width: 100%; margin-top: 20px;"></audio> <div id="playlist"></div> <script> const musicFiles = [ <?php foreach ($audioFiles as $file) { echo json_encode($musicDir . "/" . $file) . ",\n"; } ?> ]; const playlist = document.getElementById('playlist'); const player = document.getElementById('player'); musicFiles.forEach((file, index) => { const name = file.split('/').pop(); const div = document.createElement('div'); div.className = 'track'; div.textContent = `${index + 1}. ${name}`; div.onclick = () => { player.src = file; player.play(); }; playlist.appendChild(div); }); // Play a random track on load if (musicFiles.length > 0) { const randomIndex = Math.floor(Math.random() * musicFiles.length); player.src = musicFiles[randomIndex]; player.play(); } </script> </body> </html>
Copyright ©2021 || Defacer Indonesia