ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Clear all EventListeners

Open botondbutuza opened this issue 9 years ago • 2 comments

More of a question than an issue - I have one or two event listeners set on a SimpleExoPlayer, and I was wondering if it would be possible to remove all of them with one utility method, instead of having to retain instances of the listeners.

botondbutuza avatar Jan 16 '17 17:01 botondbutuza

This isn't supported, so you'll need to keep references to the instances so that you can pass them to the remove method. Having a method to clear all listeners may end up being more confusing than it is helpful, since components like SimpleExoPlayerView add themselves as listeners to the player, and it's quite likely that a developer calling such a method wont realize they're detaching the view from the player by doing so.

ojw28 avatar Jan 16 '17 23:01 ojw28

That's a very good point, thank you for clarifying. :)

botondbutuza avatar Jan 17 '17 09:01 botondbutuza