startFraction method

double startFraction(
  1. Duration duration
)

Assumes that duration is the total length of the video that this DurationRange is a segment form. It returns the percentage that start is through the entire video.

For example, assume that the entire video is 4 minutes long. If start has a duration of one minute, this will return 0.25 since the DurationRange starts 25% of the way through the video's total length.

Implementation

double startFraction(Duration duration) {
  return start.inMilliseconds / duration.inMilliseconds;
}