youtube_player_flutter
youtube_player_flutter copied to clipboard
How to know the total length of video through controller?
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?
- Total duration,
controller.value.metaData.duration.inSeconds
- Current position,
controller.value.position.inSeconds
@prashantspandey if this answers your question please close this issue.
here is example how to get it here
- 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.