react-timeline-editor icon indicating copy to clipboard operation
react-timeline-editor copied to clipboard

Is there any way for the time not to start at 0?

Open mcosti opened this issue 1 year ago • 2 comments

Hey! Awesome library, thank you for your work.

Did anyone figure out a way for the timeline to start at negative values?

My use case is syncing an audio offset which would great improve my UX if it would be possible for the timeline to start at negative values. Right now what I did is I pushed both actions more to the right so there is a virtual offset, but it requires quite a lot of effort in synchronizing it with a videoplayer.

Thanks

mcosti avatar Nov 23 '23 13:11 mcosti

Kind of answered my question, at least for my use case:

Adding minStart on the action as a negative value works

mcosti avatar Nov 24 '23 20:11 mcosti

Nice! Here's how I did it in my use case by using the getScaleRender prop:

// ...

function getScaleRender(scale: number) {
  return <>{scale + 1}</>;
}

// ...

function TimelineComponent() {
  // ...
  return (
    <Timeline
      // ...
      getScaleRender={getScaleRender}
    />
  );
}

zane-programs avatar Dec 24 '23 01:12 zane-programs