Read the Post

May 13, 2012

Frustration Solved: How to Loop a Playlist in JPlayer

OK. This is total geekiness, but that’s just who I am. I’ve spent the last few hours (at least!) looking for any documentation that explains how to have a playlist you create in JPlayer loop by default. I knew it had to be possible since there’s a nifty “repeat” command built right into the player. But I’ll be damned if anybody over at JPlayer HQ actually included it in the documentation for their Playlist Add-on!

I searched their website. I searched their Google support group. I searched numerous other geeky outlets and found nothing. Am I really the only person who wants this? Or am I the only person too dense to guess how it works on his own? (OK, don’t answer that…)

Guessing is exactly what I did – over and over again – and after a lot of frustration I finally guessed correctly. So, in hopes that it would help anyone else figure this out, I thought I would post my answer right here! That’s what this Web Design category is supposed to be all about after all.

Let’s get down to business. It turned out to be as simple as including a Boolean true|false in the setup of the Playlist. But what setting and where? It seems obvious enough now that I see it, but here it is spelled out for anyone else who might be struggling. Here’s the nitty gritty on how set up a playlist using JPlayer‘s amazing Playlist Add-on – one that will loop forward and backward:

    var myPlaylist = new jPlayerPlaylist({
        jPlayer: "#jp_player",
        cssSelectorAncestor: "#jp_container"
    }, [
            title:"Your Title 1",
            title:"Your Title 2",
    ], {
        playlistOptions: {
            loopOnPrevious: true
        loop: true,
        swfPath: "/path/to/directory/with/Jplayer",
        supplied: "mp3"


It’s as simple as including that loop: true setting along with the loopOnPrevious: true setting inside the playlistOptions section. That gets your playlist looping forward and back – so that the playlist will repeat on playback and loop forward and back by clicking the previous or next buttons.

Whew! One headache solved for myself. Hope it helps! Let me know if it does…

Geeky Tips
Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy
Text Widget
Aliquam erat volutpat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer sit amet lacinia turpis. Nunc euismod lacus sit amet purus euismod placerat? Integer gravida imperdiet tincidunt. Vivamus convallis dolor ultricies tellus consequat, in tempor tortor facilisis! Etiam et enim magna.