Future streamFile(File file, {int chunkSize, int sleepMs: 0, bool resumable: true})

Streams a file to this response as chunked data.

Useful for video sites.

Source

streamFile(File file,
    {int chunkSize, int sleepMs: 0, bool resumable: true}) async {
  if (!isOpen) return;

  header(HttpHeaders.CONTENT_TYPE, lookupMimeType(file.path));
  willCloseItself = true;
  await file.openRead().pipe(underlyingResponse);
  /*await chunked(file.openRead(), chunkSize: chunkSize,
      sleepMs: sleepMs,
      resumable: resumable);*/
}