mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
405 stars 137 forks source link

Playlist plugin fails at the end of playlist run #223

Open pakal opened 2 years ago

pakal commented 2 years ago

As we see in this except, at the end, the playlist still tries to load an items OUT of bounds, which is undefined, so the mediaelement player makes errors ; it should be "< player.listItems.length - 1".

player.endedCallback = function () {
    if (player.currentPlaylistItem < player.listItems.length) {
        player.setSrc(player.playlist[++player.currentPlaylistItem]);
        player.load();
        setTimeout(function () {
            player.play();
        }, 200);
    }
};