mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 09:16:19 +01:00
Auto play video after loaded
This commit is contained in:
parent
2bdcaede9d
commit
43aa12ed57
1 changed files with 3 additions and 1 deletions
|
@ -93,7 +93,6 @@ class _VideoViewerState extends State<VideoViewer> {
|
|||
);
|
||||
await _controller.initialize();
|
||||
widget.onLoaded?.call();
|
||||
setState(() {});
|
||||
WidgetsBinding.instance!.addPostFrameCallback((_) {
|
||||
if (_key.currentContext != null) {
|
||||
widget.onHeightChanged?.call(_key.currentContext!.size!.height);
|
||||
|
@ -101,6 +100,9 @@ class _VideoViewerState extends State<VideoViewer> {
|
|||
});
|
||||
_controller.addListener(_onControllerChanged);
|
||||
_isControllerInitialized = true;
|
||||
setState(() {
|
||||
_play();
|
||||
});
|
||||
} catch (e, stackTrace) {
|
||||
_log.shout("[_initController] Failed while initialize", e, stackTrace);
|
||||
SnackBarManager().showSnackBar(SnackBar(
|
||||
|
|
Loading…
Reference in a new issue