Replies: 1 comment
-
You can get video duration once video has initialised: _betterPlayerController.setupDataSource(BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.bugBuckBunnyVideoUrl,
));
_betterPlayerController.addEventsListener((event){
if (event.betterPlayerEventType == BetterPlayerEventType.initialized){
var duration = _betterPlayerController.videoPlayerController?.value.duration ?? Duration();
print("Video duration: $duration");
}
}); You can't get video duration earlier. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do you get the video duration before the video starts? I need to know the video length ahead of play for another animation.
Printing the duration is null (see print below).
Beta Was this translation helpful? Give feedback.
All reactions