vikram25897/flutter_cached_video_player

How can i delete a cached video

Opened this issue · 2 comments

I have tried to delete cached video but i cannot find the method or function for this. I have asked in stack overflow and have gotten 0 suggestions.
Any suggestions will be appreciated thank you

Can you show your code?
Do you have the system file path?

Check if it helps:

  Future<void> deleteFile(File file) async {
    try {
      if (await file.exists()) {
        await file.delete();
      }
    } catch (e) {
      // Error in getting access to the file.
    }
  }

Can be used like:

ElevatedButton(
   onPressed: () { deleteFile(File(outputPath)); }, 
   child: Text('Delete')),
}

Thanks,
That’s exactly my problem I can’t seem to have access to the file path @brainunknown. I can’t seem to find the cached video file and I don’t think there is a method from the package that states how to do so