INNER CODE UNIT · Dart
newDuration
LeGoffMael/video_editor · lib/src/controller.dart:282
final double newDuration = videoDuration.inMicroseconds * (max - min);
// since [Duration] object does not takes integer we must round the
// new duration up and down to check if the values are correct or not (#157)
final Duration newDurationCeil = Duration(microseconds: newDuration.ceil());
final Duration newDurationFloor =
Duration(microseconds: newDuration.floor());
assert(newDurationFloor <= maxDuration,
'Trim duration ($newDurationFloor) cannot be smaller than $minDuration');
assert(newDurationCeil >= minDuration,
'Trim duration ($newDurationCeil) cannot be bigger than $maxDuration');
_minTrim = min;
_maxTrim = max;
_updateTrimRange();
}
void _updateTrimRange() {
_trimStart = videoDuration * minTrim;