Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mediaelement.js and custom playlist

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.

like image 887
webvitaly Avatar asked Aug 08 '12 15:08

webvitaly


1 Answers

Now there is a plugin that solves this task - https://github.com/duozersk/mep-feature-playlist

like image 184
Andrew Berezovsky Avatar answered Oct 24 '22 01:10

Andrew Berezovsky