Closed heyallieson closed 1 year ago
Resolution: Found the fix but not sure why. I figured out a way to get a file path and convert that instead. Thanks.
Hey, @heyallieson noticing that you faced the same exact issue I had. I'm also using the photo_manager package. Can you walk me through at what point you made the path conversation and how you did it? I'd really appreciate it. Thanks!
hey @ChristineWasike! It's been a bit, so let me know if any of the details seem off.
I used the photo_manager package to display images and videos in a grid. Then I got the asset's data with snapshot.data and got the media url using .getMediaUrl(); This returns the asset's path.
FutureBuilder(
future: index.thumbnailDataWithSize(),
builder: ((context,snapshot) {
if (asset == AssetType.video) {
var asset = snapshot.data
var mediaSelected = asset.getMediaUrl();
return Widget
}
})
)
I wanted to compress it before going to the video trimmer, so I compressed it and then sent that path to the video trimmer. I also found this reduced any weird coloring the video trimmer showed when the video wasn't compressed.
Hope that helps!
Hey @sbis04! Thanks for making this awesome package. I'm excited about the opportunities video_trimmer offers! I just started to use it but when I try to load a video, I hit an error that isn't too descriptive: 'Unhandled Exception: PlatformException(VideoError, Failed to load video: Cannot Open, null, null).'
I'm hoping you can help. It may be due to the file structure I'm passing. I'm using a package called photo_manager instead of file_picker as you have shown in the example. It provides an Asset Entity so I converted it into a File like this:
The file it creates is something like this path. I thought it could have been due to the suffix, so I tried with a .mp4 and .mov too.:
File: '/var/mobile/Containers/Data/Application/C6CBC30B-39CE-4120-AA1F-358D477BFDD8/Library/Caches/2023-03-09 10:44:19.049726'
Then like normal, I navigate to
VideoTrim(file: file)
. My VideoTrim file is pretty simple as I'm just trying to load the video. Here it is just to show:Thanks so much for your extra eyes. Thanks so much for creating this package. I'm really excited about it!