story_view
story_view copied to clipboard
How to set Progress bar duration according to my mp4 video duration. I am getting video from JSON API response.
List<StoryItem> storyItems = [ StoryItem.pageVideo( item['video'], controller: StoryController(), ) ]; return Material( child: StoryView( storyItems: storyItems, onComplete: () { Navigator.pop(context); }, onVerticalSwipeComplete: (direction) { if (direction == Direction.down) { Navigator.pop(context); } }, controller: StoryController(), ), );
in video_player
you can get the video file duration by listening to the video player stream
but you can also get the video duration from the api response from backend