loadVideo method

void loadVideo(
  1. VoidCallback onComplete
)

Implementation

void loadVideo(VoidCallback onComplete) {
  if (this.videoFile != null) {
    this.state = LoadState.success;
    onComplete();
  }

  final fileStream = DefaultCacheManager()
      .getFileStream(this.url, headers: this.requestHeaders as Map<String, String>?);

  fileStream.listen((fileResponse) {
    if (fileResponse is FileInfo) {
      if (this.videoFile == null) {
        this.state = LoadState.success;
        this.videoFile = fileResponse.file;
        onComplete();
      }
    }
  });
}