sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
692 stars 785 forks source link

[youtube_player_iframe BUG] position zero #405

Open zxl777 opened 3 years ago

zxl777 commented 3 years ago

Step 1: Modify the source code. youtube_player_iframe/example/lib/main.dart

  void initState() {
    super.initState();

   ......

    Timer.periodic(const Duration(milliseconds: 50), (Timer timer) {
      print(_controller.value.position);
    });
  }

Step2 : flutter run , position is always 0.

I/flutter (28089): 0:00:00.000000
I/flutter (28089): 0:00:00.000000
I/flutter (28089): 0:00:00.000000

Step 3 : Hot Restart The position starts to refresh after a few seconds.

I/flutter (28089): 0:00:00.000000
I/flutter (28089): 0:00:00.000000
I/flutter (28089): 0:00:00.000000
I/flutter (28089): 0:00:00.000000
I/flutter (28089): 0:01:37.020000
I/flutter (28089): 0:01:37.020000
I/flutter (28089): 0:01:37.521000
I/flutter (28089): 0:01:37.845000
itssidhere commented 3 years ago

That's what I was asking @sarbagyastha . Any progress on this?