etro-js / etro

Typescript video-editing framework for the browser
https://etrojs.dev
GNU General Public License v3.0
899 stars 86 forks source link

Custom duration for `play()` #181

Closed clabe45 closed 1 year ago

leanjunio commented 1 year ago

Would it be possible to get more context on this? I'd love to tackle it.

Would duration just be a number that represents seconds? And is the idea just that if play() is passed a duration, the move would just play for that many seconds?

clabe45 commented 1 year ago

Hey, yes to both. It would be a number in seconds, and it would stop after that many seconds passes. The record function already supports a duration, you can use that for reference.

leanjunio commented 1 year ago

@clabe45 for this to work, do we just need to update this._endTime to be this.currentTime + duration?

clabe45 commented 1 year ago

Yeah, move the assignment from stream to play (stream calls play)

leanjunio commented 1 year ago

I have https://github.com/etro-js/etro/pull/208 for this