Add missing await

This commit is contained in:
Neeraj Gupta 2024-02-20 06:39:56 +05:30
parent 9a1e8da500
commit e4e38085f3

View file

@ -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);
}
});
}
}