Skip to content
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

[FEATURE] Expose the eventListeners within the better_player_controller.dart file #584

Closed
Letalus opened this issue Jun 30, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@Letalus
Copy link
Contributor

Letalus commented Jun 30, 2021

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

@Letalus Letalus added enhancement New feature or request new issue New issue which has not been checked yet labels Jun 30, 2021
@Letalus
Copy link
Contributor Author

Letalus commented Jun 30, 2021

pull request for feature is within #585

@jhomlala
Copy link
Owner

jhomlala commented Jul 8, 2021

@Letalus I don't see any connection with exposing event listeners from BetterPlayerController and limits of Android ExoPlayer/iOS AVPlayer instances. Please elaborate it.

@jhomlala jhomlala added info required The issue author didn't provide required informations. and removed enhancement New feature or request new issue New issue which has not been checked yet labels Jul 8, 2021
@Letalus
Copy link
Contributor Author

Letalus commented Jul 8, 2021

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

@jhomlala
Copy link
Owner

jhomlala commented Jul 8, 2021

Okay, this will be included in next release.

@jhomlala jhomlala added enhancement New feature or request and removed info required The issue author didn't provide required informations. labels Jul 8, 2021
@jhomlala
Copy link
Owner

jhomlala commented Jul 9, 2021

Added in 0.0.71.

@jhomlala jhomlala closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants