duration property

  1. @override
Future<double> duration

Returns the duration in seconds of the currently playing video. Note that duration will return 0 until the video's metadata is loaded, which normally happens just after the video starts playing.

If the currently playing video is a live event, the duration will return the elapsed time since the live video stream began. Specifically, this is the amount of time that the video has streamed without being reset or interrupted. In addition, this duration is commonly longer than the actual event time since streaming may begin before the event's start time.

Implementation

@override
Future<double> get duration async {
  final duration = await _runWithResult('getDuration');
  return double.tryParse(duration) ?? 0;
}