You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flutter: Cached video of [https://cdn.xxxx.top/SocialFit/post/SnapVid.Net_3241856401650611273.mp4] is: /var/mobile/Containers/Data/Application/DB92663F-B5FA-4A42-A254-F970651F9D08/Library/Caches/libCachedVideoPlayerPlusData/b93e1750-5555-11ef-9065-0bc8c40944f8.mp4
flutter: Cached video of [https://cdn.fxxxxx.top/SocialFit/post/1723092727753_15116.mp4] is: /var/mobile/Containers/Data/Application/DB92663F-B5FA-4A42-A254-F970651F9D08/Library/Caches/libCachedVideoPlayerPlusData/af07f490-5555-11ef-9065-0bc8c40944f8.bin
i am also getting url end with c8c40944f8.bin in ios real device, in android working fine. while caching video its save with c8c40944f8.bin. can you help me out why is it happend?
@OutdatedGuy Same problem here, only IOS files caches with .bin enviroment. Furthermore, I added the code below where it expects the video to be downloaded from the network when the .bin file is received and it also doesn't work, no download from the network.
I checked the flutter_cache_manager code and it is setting the file extension using the contentType header. I don't think there is much to do if you don't have control of the server. We are trying to fix the issue on server side and I'll report back the result when done.
It appears the root of this issue lies within the flutter_cache_manager package, which is beyond my direct control to fix.
If you're encountering this problem, here are two potential workarounds:
1. If you own the content server
You can resolve this by configuring your server to correctly set the Content-Type header in its responses. This header is crucial for determining the file extension. For more details, refer to these comments: comment 1 and comment 2.
2. If you don't own or cannot configure the content server
You can override the flutter_cache_manager dependency to use a community-contributed fix. Add the following to your pubspec.yaml file:
While these workarounds don't guarantee a 100% fix, they should significantly mitigate the issue until a proper solution is implemented in the underlying package.
@OutdatedGuy There are exposed methods and getters inside flutter_cache_manager where I think you can define a simple extension method and override its behavior to preserve the file extension.
The only part that needs to be simulated (based on how this library works) is managing the CacheObject
Here is a similar extension method (though it’s not ideal in this case, as it renames the file after it has already been saved with a .bin extension). It should at least give the idea: Baseflow/flutter_cache_manager#405 (comment)
I didn’t have time to fully explore how the default download method creates the CacheObject, but I believe it’s possible to mock that and save it with the correct extension directly.
This way, there’s no need to use a dependency override anymore.
Activity
tudosxxx commentedon Aug 8, 2024
flutter: Cached video of [https://cdn.xxxx.top/SocialFit/post/SnapVid.Net_3241856401650611273.mp4] is: /var/mobile/Containers/Data/Application/DB92663F-B5FA-4A42-A254-F970651F9D08/Library/Caches/libCachedVideoPlayerPlusData/b93e1750-5555-11ef-9065-0bc8c40944f8.mp4
flutter: Cached video of [https://cdn.fxxxxx.top/SocialFit/post/1723092727753_15116.mp4] is: /var/mobile/Containers/Data/Application/DB92663F-B5FA-4A42-A254-F970651F9D08/Library/Caches/libCachedVideoPlayerPlusData/af07f490-5555-11ef-9065-0bc8c40944f8.bin
OutdatedGuy commentedon Aug 9, 2024
Are only selected urls being cached as
.binfiles or any file is cached as.bin?Also can you just try with the video_player plugin and see if all your urls work properly there?
hasuwebforest commentedon Aug 23, 2024
i am also getting url end with c8c40944f8.bin in ios real device, in android working fine. while caching video its save with c8c40944f8.bin. can you help me out why is it happend?
OutdatedGuy commentedon Sep 16, 2024
@hasuwebforest Can you try with video_player as mentioned in this comment.
chahohbily commentedon Sep 21, 2024
@OutdatedGuy Same problem here, only IOS files caches with .bin enviroment. Furthermore, I added the code below where it expects the video to be downloaded from the network when the .bin file is received and it also doesn't work, no download from the network.
With a normal video_player everything works stably!!!
Oliver-WJ commentedon Oct 30, 2024
This can solve your problem:
dependency_overrides:
flutter_cache_manager:
git:
url: https://github.com/Oliver-WJ/flutter_cache_manager.git
path: flutter_cache_manager
Musaddiq625 commentedon Dec 5, 2024
#54
guneyozsan commentedon Jan 9, 2025
I checked the
flutter_cache_managercode and it is setting the file extension using thecontentTypeheader. I don't think there is much to do if you don't have control of the server. We are trying to fix the issue on server side and I'll report back the result when done.If you need the details, I left a comment on the relevant issue in
flutter_cache_managerrepo:guneyozsan commentedon Feb 24, 2025
We fixed this by setting the header on the server as
video/mp4.OutdatedGuy commentedon Jul 8, 2025
It appears the root of this issue lies within the
flutter_cache_managerpackage, which is beyond my direct control to fix.If you're encountering this problem, here are two potential workarounds:
1. If you own the content server
You can resolve this by configuring your server to correctly set the
Content-Typeheader in its responses. This header is crucial for determining the file extension. For more details, refer to these comments: comment 1 and comment 2.2. If you don't own or cannot configure the content server
You can override the
flutter_cache_managerdependency to use a community-contributed fix. Add the following to yourpubspec.yamlfile:While these workarounds don't guarantee a 100% fix, they should significantly mitigate the issue until a proper solution is implemented in the underlying package.
AliAzizi commentedon Sep 23, 2025
@OutdatedGuy There are exposed methods and getters inside
flutter_cache_managerwhere I think you can define a simple extension method and override its behavior to preserve the file extension.The only part that needs to be simulated (based on how this library works) is managing the
CacheObjectHere is a similar extension method (though it’s not ideal in this case, as it renames the file after it has already been saved with a
.binextension). It should at least give the idea:Baseflow/flutter_cache_manager#405 (comment)
I didn’t have time to fully explore how the default download method creates the
CacheObject, but I believe it’s possible to mock that and save it with the correct extension directly.This way, there’s no need to use a dependency override anymore.