xzdarcy / react-timeline-editor

react-timeline-editor is a react component used to quickly build a timeline animation editor.
https://zdarcy.com/
MIT License
284 stars 82 forks source link

Events when cursor drag start and cursor drag stop #4

Closed ftirej closed 1 year ago

ftirej commented 1 year ago

Hi im using the timeline as a player timeline for video. Im setting the time from the timestamp of the video. Can you add a drag start and drag stop to get the time from the timeline and set the video time?. This way i can stop setting the time of the timeline from the video while is im dragging the cursor. By the way! great job! and thanks for the hard work.

xzdarcy commented 1 year ago

I added the following two parameters and released the test version 0.1.4-alpha.0. You can try if it meets your needs image

ftirej commented 1 year ago

Hi, it worked like a charm. Maybe this events could also be added to the TimelineState so we can listen to the start and end. This way you can set different events to the video player, like set the current position of the video.

xzdarcy commented 1 year ago

Hi, it worked like a charm. Maybe this events could also be added to the TimelineState so we can listen to the start and end. This way you can set different events to the video player, like set the current position of the video.

Hi, are you meaning for the engine event? The events of the engine have been exposed through TimelineState (In my design, TimelineState is used to expose some APIs of the built-in engine). You can get more engine event information from the link.

  timelineState.listener.on('afterSetTime', () => {
    ...
  })