Skip to content

Commit

Permalink
fix control video player
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Dec 12, 2023
1 parent 189fab6 commit 8cd4352
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/screen/interactive_postcard/postcard_explain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ class _PostcardExplainState extends State<PostcardExplain> {

@override
void initState() {
unawaited(_initPlayer());
_viewClaimPage = !widget.payload.isPayToMint;
if (_viewClaimPage) {
unawaited(_initPlayer());
} else {
unawaited(_colouringController.play());
}
_swiperController = SwiperController();
super.initState();
unawaited(injector<ConfigurationService>().setAutoShowPostcard(false));
Expand All @@ -60,6 +64,8 @@ class _PostcardExplainState extends State<PostcardExplain> {
await _colouringController.initialize().then((_) {
_colouringController.setLooping(true);
});

await _controller.play();
}

@override
Expand Down Expand Up @@ -140,9 +146,6 @@ class _PostcardExplainState extends State<PostcardExplain> {
setState(() {
_currentIndex = index;
if (index == 0) {
unawaited(_controller.play());
}
if (index == 1) {
unawaited(_colouringController.play());
}
});
Expand Down Expand Up @@ -252,6 +255,9 @@ class _PostcardExplainState extends State<PostcardExplain> {
setState(() {
_viewClaimPage = false;
});
Future.delayed(const Duration(milliseconds: 50), () {
unawaited(_colouringController.play());
});
},
),
const SizedBox(height: 10),
Expand Down

0 comments on commit 8cd4352

Please sign in to comment.