Looping a Video

To have a node, or a series of nodes repeat (“loop”), you have the option of listening to the node end events and using the stream modifier append to repeat the node as it ends. Since looping is a rather common use case, the Interlude player exposes functionality to allow you to easily achieve this using the looper plugin. In order to start a loop, use

player.looper.push('loop1', 'loop2'); // Will play loop1 => loop2 => loop1 => ...

Any node appended to the playlist while a loop is in progress will not play until the loop had ended.

player.append('someOtherNode'); // Will not actually be pushed to playlist until player.looper.finish() is called.

Any node appended to the playlist while a loop is in progress will not play until the loop had ended. To exit the loop use

player.looper.finish({seek: true});

The seek parameter determines whether the loop ends immediately and seeks to the next node in the playlist, or waits until the current iteration of the loop has ended.

Rate this page: X
Tell us more!