parent
1c34a2ec1f
commit
652e4327ea
1 changed files with 4 additions and 8 deletions
|
@ -252,14 +252,10 @@ class _VideoWidgetNewState extends State<VideoWidgetNew>
|
|||
|
||||
void _setVideoController(String url) {
|
||||
if (mounted) {
|
||||
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);
|
||||
}
|
||||
setState(() {
|
||||
player.setPlaylistMode(PlaylistMode.single);
|
||||
controller = VideoController(player);
|
||||
player.open(Media(url), play: _isAppInFG);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue