-1
Hello, I want to make a local player with HTML. I want to play locally, without uploading. I want to select a folder with music or video files and play randomly. Below follows my website with the demo: https://piersoft.net/robles/player/
I wanted this input instead of "Select File" to be "Select Folder", and after selecting it, I would click RANDOM and play a random file from the folder. The link shows how far I’ve come. Edit: when I select a file, instead of appearing the path, it appears "fakepath". There is no way to select the entire folder?
Follows my code:
<body>
<div class="container">
<h1>Player</h1>
<br>
<br>
<input type="file" id="video" value="">
<input type="button" id="random" value="RANDOM">
<br><br>
<p id="urlText"></p>
<br><br>
<video id="custom_video_play" width="400" controls="controls">>
<source src="" type="video/mp4"> Browser Not Supporting
</video>
</div>
<script>
$("#video").change(function(){
const url = $("#video").val()
alert(url)
$("#urlText").text("URL ("+ url + ")")
$("source").attr('src', url)
});
</script>
</body>
Good, great answer!
– user170164
You’ve helped me, thank you!!
– Thiago Robles