Is it possible to add the error handling mechanism if video player failed to load source? Currently, It'll stay in loading state forever.
I read your code & found that maybe you can define a new variable "errorCatched" like initialized variable, and set its value in your listener method like below:
if (!mounted) {
return;
}
if (controller != null) {
if (controller.value.initialized) {
...
}
else if (controller.value.hasError) {
setState(() {
errorCatched = true;
});
}
}
And then use this value to change the loading state & notify the parent widget.
Please let me know if I'm wrong.
Thanks.
Hello,
Is it possible to add the error handling mechanism if video player failed to load source? Currently, It'll stay in loading state forever. I read your code & found that maybe you can define a new variable "errorCatched" like initialized variable, and set its value in your listener method like below:
And then use this value to change the loading state & notify the parent widget. Please let me know if I'm wrong. Thanks.