getPlayablePath method

Future<String> getPlayablePath(
  1. String url, {
  2. Map<String, String>? headers,
})

Get playable path for a video URL. Waits for minimum bytes if file is empty/small, then returns path. Download continues in background after path is returned. Automatically detects and handles HLS (.m3u8) URLs.

Implementation

Future<String> getPlayablePath(
  String url, {
  Map<String, String>? headers,
}) async {
  // Check if HLS
  if (HlsParser.isHlsUrl(url)) {
    return _getHlsPlayablePath(url, headers);
  }

  return _getMp4PlayablePath(url, headers);
}