probe static method

Future<XVideoProbeResult?> probe({
  1. required String path,
  2. int atMs = 0,
  3. int? maxWidth = 320,
})

Probes path. Null when the file yields no video track at all. maxWidth caps the poster's width (aspect preserved); null asks for the frame at native resolution.

Implementation

static Future<XVideoProbeResult?> probe({
  required String path,
  int atMs = 0,
  int? maxWidth = 320,
}) async {
  final result = await _channel.invokeMapMethod<String, Object?>('probe', {
    'path': path,
    'atMs': atMs,
    'maxWidth': maxWidth,
  });
  if (result == null) return null;
  final width = (result['width'] as num?)?.toInt();
  final height = (result['height'] as num?)?.toInt();
  final durationMs = (result['durationMs'] as num?)?.toInt();
  if (width == null || height == null || durationMs == null) return null;
  return XVideoProbeResult(
    width: width,
    height: height,
    durationMs: durationMs,
    posterPng: result['png'] as Uint8List?,
  );
}