fluttercommunity / fluttercommunity/chewie
error when autoPlay is true: Future already completed
- Dominant language
- Dart
- Stars
- 2.1k
- Forks
- 1.1k
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 6
Description
I was getting what seems to be a race condition or error when trying to pass `autoPlay: true` into a video widget implemented with Chewie.
I was able to work around by not using the `autoPlay` flag on Chewie, but adding a condition to a `then` function after `initialize()` completes. In this case, `widget` is my widget that implements Chewie.
_controller.initialize().then((_) {
if (widget.options.autoPlay) {
_controller.play();
}
});
But despite being able to work around it, this seems like a bug and that Chewie should be able to handle doing this (or the autoPlay flag should be removed).
Wondering if there is an issue awaiting the `_controller.initialize()` in the `chewie_player.dart` file in the initialize method.
It may be related to this issue: https://github.com/flutter/flutter/issues/19197
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.