getAbsolutePosition method

  1. @override
Future<DateTime?> getAbsolutePosition(
  1. int? textureId
)
override

Gets the video position as DateTime.

Implementation

@override
Future<DateTime?> getAbsolutePosition(int? textureId) async {
  final int milliseconds = await _channel.invokeMethod<int>(
        'absolutePosition',
        <String, dynamic>{'textureId': textureId},
      ) ??
      0;

  if (milliseconds <= 0) return null;

  return DateTime.fromMillisecondsSinceEpoch(milliseconds);
}