Closed Letalus closed 3 years ago
pull request for feature is within #585
@Letalus I don't see any connection with exposing event listeners from BetterPlayerController
and limits of Android ExoPlayer/iOS AVPlayer instances. Please elaborate it.
hmm I guess I worded it badly. Due to the fact that I need to recycle the controllers, remove all the listeners and after the controller and its listeners have been recycled, initialize it again and add a new listener to it, I need to be able to tell if there are currently active listeners. By exposing the eventListeners, I'm able to do exactly that
Okay, this will be included in next release.
Added in 0.0.71.
Feature: Exposes all active eventListeners within the better_player_controller.dart file
Argument: This functionality is useful when user are working with recycleController (controllers which will be reused after they have been disposed, or after the video has changed). A good use case is if the user has a list of 100 videos within a pageviewer, creates 3 videoplayer, which then will be used to show all 100 videos (the pageviewer is always preloading the video before and after the current video). This approach avoids within android the OOM Bug (because in android you can only create around 3 video player instances and after that the system won't let you create more) Within iOS it is the same, except that you are able to create exactly 32 instances of the avplayer.
Conclusion: By exposing the eventListeners, the developers are enabled to recycle the videos more efficiently