dotlottie-web
dotlottie-web copied to clipboard
Add segment duration getter
Overview
I suggest adding a getter to get the duration of a given segment [startFrame, endFrame].
const player = new DotLottie({ segment: [0, 100], /* other params */ })
const frameRate = player.totalFrames / player.duration;
const segmentDuration = 1000 * (player.segment[1] - player.segment[0] + 1) / frameRate;
Type
- [ ] New feature
Motivation
I needed to determine how much time remained before the segment would finish playing after some time
Labels
- [ ] Add the
Type: Feature Request
label to this issue.