Reputation: 12626
I'm trying to play videos as user swipe to left or right.
I was able to play next or previous video by using NotificationListener
.
If user swipe to left, pass next url and initialize, if swipe right vice versa.
However with this approach, video will be initialized after user swiped.
So, it takes a couple of seconds to play.
How can I make this more efficiently?
Do I have to initialize next video while current video playing or similar?
Can someone guide me to the correct way please?
Thank you in advance!
Upvotes: 0
Views: 1172
Reputation: 658067
You can try adding the video widget using https://api.flutter.dev/flutter/widgets/Offstage-class.html to initialize it before it is shown to the user.
Upvotes: 1