dotlottie-web icon indicating copy to clipboard operation
dotlottie-web copied to clipboard

Add segment duration getter

Open rismirnov opened this issue 9 months ago • 1 comments

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.

rismirnov avatar May 16 '24 09:05 rismirnov