Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
739 stars 427 forks source link

cache mp4 video file not played by VideoPlayer package on ios #405

Open muhammadCodeSh opened 1 year ago

muhammadCodeSh commented 1 year ago

🐛 Bug Report

I use flutter cache manager last version to cache images and videos it works well on android also on ios it cache and shows image files perfectly, but cached mp4 or .ts video files can not be played by the Video player package on ios, is it required any extra configuration or permission on ios?

Platform:

osangma commented 11 months ago

same issue

jerrypaulsam commented 7 months ago

The file extension is .bin, so the iOS video player isn't playing it. I renamed the file with a .mp4 extension, and now it is working.

voltzylex commented 5 months ago

use this // 1> fileinfo will provide name of the path in which video is stored in temporary directory var fileInfo = await DependencyInjection.kCacheManager .getFileFromCache("Your url");

// 2> using rename function will change the name of the path final name = await fileInfo!.file .rename(fileInfo.file.path.replaceAll(".bin", ".mp4"));

// 3> after that use the name on your link

controller = VideoPlayerController.file(name)

// work like a charm