-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
Once the video has initialized and at least one frame has been rendered, if any subsequent error occurs on the platform, the video will disappear.
This is because of this code in video_player.dart
void errorListener(Object obj) {
final PlatformException e = obj;
value = VideoPlayerValue.erroneous(e.message);
_timer?.cancel();
if (!initializingCompleter.isCompleted) {
initializingCompleter.completeError(obj);
}
}
This code ends up replacing the value with one that has a null'd size property, and that causes the VideoPlayer to not be able to render it when surrounding it by an AspectRatio widget, or something similar, which needs the size to be able to lay it out.
Once the video has been initialized, any errors afterwards should not cause the video to become impossible to render. It would be best to let the consumer know the video has an error, but the last frame should remain on screen.
This has become more prominent with the potential errors that can be returned as a result of flutter/plugins#3084.