JSignage:PlaylistTutorial6
From SpinetiX Support Wiki
Description
Playlist with shuffle and repeat
- Instead of setting the data attribute when the playlist is created, an iterating handler is installed to shuffle the playlist each time it loops.
Source code
var list = [];
for ( var i=1; i<18; i++ )
list.push( 'media/Monet_4_3/' + i + '.jpg' );
$.playlist({
left: 240,
top: 60,
width: 800,
height: 600,
iterating: function() { this.data = $.shuffle( list ); },
defaultDur: 3,
defaultTransition: $.crossFade(),
repeatCount: 'indefinite'
}).addTo( 'svg' );