Description
Describe the bug
I am not sure that it's a Widget
- related issue or the retrieved file itself, but displaying the content of assetEntity.file
in the official example code of this plugin is showing a black rect on the screen if assetEntity.file
is supposed to retrieve an edited video (iOS only, have not tested on Android).
From a UI point of view, it seems that this rect
has a width equal to the cropped
region in the edited video.
Hard to tell for the height since we don't see the real edited video content in the widget despite the BoxFit.fill
or BoxFit.cover
.
To Reproduce
Steps to reproduce the behavior:
- Edit a video (crop it in your iPhone's photo app)
- Run the official example code
- Show detail page of the edited video
- See the black screen
We can see this behavior using also assetEntity.getMediaUrl
.
Expected behavior
The edited video should be rendered as it is seen in the Photos
native application on iOS.
Screenshots
RPReplay_Final1642586993.MOV
Flutter version
Smartphone (please complete the following information):
- Device: iPhone 8, iPhone XS Max, iPhone 12 Pro
- OS: iOS 15.2.1, iOS 15.1.1
Code
In the initState
of video_widget.dart
you can play with this code and see the behavior with any of the chosen method :
@override
void initState() {
super.initState();
/*
widget.entity.file.then((File? file) {
if (!mounted || file == null) {
return;
}
_controller = VideoPlayerController.file(file)
..initialize()
..addListener(() => setState(() {}));
setState(() {});
});
*/
widget.entity.getMediaUrl().then((String? url) {
if (!mounted || url == null) {
return;
}
_controller = VideoPlayerController.network(url)
..initialize()
..addListener(() => setState(() {}));
setState(() {});
});
}