JSignage:PlaylistTutorial6

From SpinetiX Support Wiki

Jump to: navigation, search

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' );

Preview

This page was last modified on 9 August 2017, at 17:18.