// Obj from database
var obj = {
playtimeMs: 3000,
segments: [
{left: 100},
{left: 100},
{left: 100},
{left: 100},
{left: 100},
{left: 100},
{left: 100},
{left: 120},
{left: 140},
{left: 160}
]
};
// time each segment
var msEachSegment = (obj.playtimeMs / obj.segments.length) / 1000;
// timeline class
var tl = new TimelineMax();
// loop through segments and add to timeline
for (var i = 0; i < obj.segments.length; i++) {
tl.to(element, msEachSegment, obj.segments[i]);
};
// playtimeline
tl.play();
Solved with this logic I created Sorry for the inconvenience, I've could know this. I tunnelvisioned on the Bezier xD
Thanks anyway gents!