I have such code (for example):
<script>
$('audio').mediaelementplayer();
</script>
<audio id="mejs" controls="controls">
<source src="/media/file-2.mp3" type="audio/mp3" />
</audio>
<ul class="mejs-list">
<li>/media/file-1.mp3</li>
<li class="current">/media/file-2.mp3</li>
<li>/media/file-3.mp3</li>
</ul>
I need to play audio files from the list by queue (one after another).
How can I change the source of the audio for the next file from the list after finishing playing current file and start playing the next one?
Update: related topic about mediaelement.js and playlist but the answer is about using many mediaelementplayer() instances.
Code for making basic playlist for mediaelement.js: