Add missing await
This commit is contained in:
parent
9a1e8da500
commit
e4e38085f3
1 changed files with 8 additions and 4 deletions
|
@ -252,10 +252,14 @@ class _VideoWidgetNewState extends State<VideoWidgetNew>
|
|||
|
||||
void _setVideoController(String url) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
player.setPlaylistMode(PlaylistMode.single);
|
||||
controller = VideoController(player);
|
||||
player.open(Media(url), play: _isAppInFG);
|
||||
setState(() async {
|
||||
try {
|
||||
await player.setPlaylistMode(PlaylistMode.single);
|
||||
controller = VideoController(player);
|
||||
await player.open(Media(url), play: _isAppInFG);
|
||||
} catch (e, s) {
|
||||
_logger.severe("failed to set video url", e, s);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue