Browse Source

fix stuck bug

hwh97 6 năm trước cách đây
mục cha
commit
46518d7105
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      example/lib/main.dart

+ 6 - 6
example/lib/main.dart

@@ -60,13 +60,13 @@ class _ChewieDemoState extends State<ChewieDemo> {
         .then((_){
       setState(() {
         lists.addAll([
-          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",  Duration(seconds: 1200), true),
+          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://vod.cdn.i2edu.net/eschool/dubit/upload/cartoon/file/2019/12/10/0744228f-98bf-4255-8adc-c04c34b486d6.mp4",  Duration(seconds: 1200), true),
           MoreVideo("http://www.i2edu.cn/images/pic04.png", "https://v-cdn.zjol.com.cn/276985.mp4", Duration(seconds: 1200), false),
-          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",  Duration(seconds: 1200), false),
+          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://vod.cdn.i2edu.net/eschool/dubit/upload/cartoon/file/2019/12/10/0744228f-98bf-4255-8adc-c04c34b486d6.mp4",  Duration(seconds: 1200), false),
           MoreVideo("http://www.i2edu.cn/images/pic04.png", "https://v-cdn.zjol.com.cn/276985.mp4", Duration(seconds: 1200), false),
-          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",  Duration(seconds: 1200), false),
+          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://vod.cdn.i2edu.net/eschool/dubit/upload/cartoon/file/2019/12/10/0744228f-98bf-4255-8adc-c04c34b486d6.mp4",  Duration(seconds: 1200), false),
           MoreVideo("http://www.i2edu.cn/images/pic04.png", "https://v-cdn.zjol.com.cn/276985.mp4", Duration(seconds: 1200), false),
-          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",  Duration(seconds: 1200), false),
+          MoreVideo("http://www.i2edu.cn/images/pic04.png", "http://vod.cdn.i2edu.net/eschool/dubit/upload/cartoon/file/2019/12/10/0744228f-98bf-4255-8adc-c04c34b486d6.mp4",  Duration(seconds: 1200), false),
           MoreVideo("http://www.i2edu.cn/images/pic04.png", "https://v-cdn.zjol.com.cn/276985.mp4", Duration(seconds: 1200), false),
         ]);
       });
@@ -149,14 +149,14 @@ class _ChewieDemoState extends State<ChewieDemo> {
   }
 
   // tracking status
-  Future<void> _controllerListener() async {
+  void _controllerListener() {
     if (_videoPlayerController1 == null || _disposed) {
       return;
     }
     if (!_videoPlayerController1.value.initialized) {
       return;
     }
-    final position = await _videoPlayerController1.position;
+    final position =  _videoPlayerController1.value.position;
     final duration = _videoPlayerController1.value.duration;
     if (duration != null && position != null) {
       final isPlaying = position.inMilliseconds < duration.inMilliseconds;