Instead of attaching directly to the user's timeline, create a new TimelineMax instance to allow for attaching to event callbacks and controlling repeats.
Rough idea of how it might used:
var playerTL = new TimelineMax();
playerTL.add( params.playerTL ); // User timeline is added and now has set the whole duration of the new Timeline.
playerTL.eventCallback('onUpdate',function(){
var p = playerTL.progress();
slider.value = p * 100;
var wasPlaying = isPlaying;
isPlaying = !playerTL.paused();
if ( wasPlaying !== isPlaying ) {
TweenMax.set( isPlaying ? play : pause, { opacity: 0 });
TweenMax.set( isPlaying ? pause : play, { opacity: 1 });
}
});
Instead of attaching directly to the user's timeline, create a new TimelineMax instance to allow for attaching to event callbacks and controlling repeats.
Rough idea of how it might used: