I am trying to add a queue for the music player on my website but I can't figure out how to do that. Can anyone help? I tryed a few things like having the code add a song in a list of songs to be played but can't get it to work. I am not so good at js and I'm just looking to see if anyone can help me. Thank you for your help and for reading this.
<script> "use strict";
function byId(e){return document.getElementById(e);} window.addEventListener('load', onDocLoaded, false);
function onDocLoaded() { byId('mFileInput').addEventListener('change', onChosenFileChange, false); }
function onChosenFileChange(evt) { var fileType = this.files[0].type; if (fileType.indexOf('audio') != -1) loadFileObject(this.files[0], onSoundLoaded); }
function loadFileObject(fileObj, loadedCallback) { var reader = new FileReader(); reader.onload = loadedCallback; reader.readAsDataURL( fileObj ); }
function onSoundLoaded(evt) { byId('sound').src = evt.target.result; byId('sound').play(); }
</script>
<body>
<h3>Select Song Below <!--<a href="JavaScript:newPopup('/player.html');"><img width="50px" height="50px" src="/assets/popout.png"></img></a>--></h3><br>
<input type="file" id="mFileInput" accept=".mp3,audio/*"><br>
<audio id="sound" controls autoplay></audio>