-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A VideoPlaverController was used after being disposed.Once you have called dispose() on a VideoplaverController, it can no longer be used. #170
Comments
I have the same problem! |
Are you using the video player inside a list - if so - what happens is that the list disposes list items as they scroll out of view. What I am doing to get around this is to set the cacheExtent on the List.builder of CustomScrollView (depending on which one you are using) to a really large value like 10000.0. Then you can scroll up and down with heaps of items without issue. However - if you did have hundreds of items you'll still hit an issue. For me its no problem as I limit my list to 50 items. |
So I faced the same problem. I compared it with the example given and I found one very silly error that I was making. It was related to making 'super' calls in initState() and dispose().
|
try this
|
in the example they have: @override
void dispose() {
_videoPlayerController?.dispose();
chewieController?.dispose();
super.dispose();
} |
TKS, it's worked . |
this doesn't worked for me |
Can you please provide a non-working example? |
I was using a list view so i just have to add cacheExtent and it solved the problem for me |
Please feel free to open a new issue if you think there is something we can do in |
I have the same problem! |
Make sure that you check if the widget is still mounted before you use the videoController |
i have the same promlem |
i have the same problem still.... My code : import 'package:better_player/better_player.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class videolsight extends StatefulWidget { @OverRide class _videolsightState extends State { @OverRide
} Please help me with this . I'm struggling for days |
Adding cache extent to the list still works to this day. You're a lifesaver, @js1972! |
The text was updated successfully, but these errors were encountered: