youtube_player_flutter icon indicating copy to clipboard operation
youtube_player_flutter copied to clipboard

How to know the total length of video through controller?

Open prashantspandey opened this issue 4 years ago • 3 comments

Hi I want to know total duration of the video through controller variable and also what position the video is playing currently in the player? what are the ways to know these two variables?

prashantspandey avatar Feb 13 '21 09:02 prashantspandey

  • Total duration, controller.value.metaData.duration.inSeconds
  • Current position, controller.value.position.inSeconds

@prashantspandey if this answers your question please close this issue.

RukshanJS avatar Sep 18 '21 17:09 RukshanJS

here is example how to get it here

StevePhuc avatar Jul 28 '23 02:07 StevePhuc

  • Total duration, controller.value.metaData.duration.inSeconds
  • Current position, controller.value.position.inSeconds

@prashantspandey if this answers your question please close this issue.

It returns 0 duration.

UmairSaqibBhutta avatar Dec 06 '23 13:12 UmairSaqibBhutta