Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
muhammadCodeSh opened this issue Mar 26, 2023 · 3 comments
Open
1 task done

Comments

@muhammadCodeSh
Copy link

muhammadCodeSh commented Mar 26, 2023

🐛 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:

  • 📱 iOS
@osangma
Copy link

osangma commented Jul 18, 2023

same issue

@jerrypaulsam
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants