How to loop a popcorn.js sequence? #370

anabelle opened this Issue Jan 15, 2014 · 2 comments

2 participants


I have created a simple sequence of videos using popcorn.js following the documentation:

I need the sequence to loop after ending so I added a listener like:

function playsequence(){;
sequence.listen( 'canplaythrough', playsequence );
sequence.listen( 'ended', playsequence );

The thing is that when the sequence ends, the last video is repeated once and then it stops.

Any idea on how could I get a loop for the entire sequence?


I've been looking at sequencer but I can't find good documentation.

I managed to do it using sequence like this:

clips = [
                src: "/video/720_1.mp4",
                in: 0,
                out: videos_duracion
                src: "/video/720_2.mp4",
                in: 0,
                out: videos_duracion

loop = 0;
function init(){
    if( typeof sequence != "undefined" ){
    sequence = Popcorn.sequence(
    sequence.listen( 'canplaythrough', );
    sequence.listen( 'ended', init );
    console.log( loop );
    loop = loop+1;


It seems to be working fine, although it sometimes stops randomly after several repetitions without throwing any error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment