Closed gamestap99 closed 4 years ago
Catch initialization errors:
bool loadingError = false;
@override
void initState() {
super.initState();
init();
}
void init() async {
vc = VideoController(
source: VideoPlayerController.network('https://example/videos/a.mp4'));
try {
await vc.initialize();
} catch (e) {
print('initialize error: '+ e.message);
setState(() {
loadingError = true;
});
}
}
Handling errors:
AspectRatio(
aspectRatio: 16 / 9,
child: loadingError ? Placeholder() : VideoBox(controller: vc),
),
Now it can only capture the initial errors of the video, and it is difficult to handle other errors during playback @gamestap99
@januwA i have a problem . I posted a new issue. please, read it
First, thank you for read question of me. Second, i want to handle error when video build error.