From 7b72f7751716048c90dd3b2940c8114888f8a1f4 Mon Sep 17 00:00:00 2001 From: befovy Date: Thu, 21 Nov 2019 09:29:13 +0800 Subject: [PATCH] fix(example): add enable-accurate-seek option, fix #113 --- example/lib/video_page.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/example/lib/video_page.dart b/example/lib/video_page.dart index 09580670..92946131 100644 --- a/example/lib/video_page.dart +++ b/example/lib/video_page.dart @@ -21,13 +21,15 @@ class _VideoScreenState extends State { @override void initState() { super.initState(); + startPlay(); + } + + void startPlay() async { + await player.setOption( + FijkOption.playerCategory, "enable-accurate-seek", 1); player.setDataSource(widget.url, autoPlay: true).catchError((e) { - FijkException fe = e as FijkException; - //setState(() { - // errorMsg = fe.message; - //}); - print("setDataSource exception: $fe"); - }, test: (e) => e is FijkException); + print("setDataSource error: $e"); + }); } @override