Is there any way to clear or deregister the videojs-contrib-ads plugin for removing event binding and such as?
JonasWater opened this issue · 1 comments
The project is great!
And the scenario I encountered: I want to remove the plugin from the current environment, for example: deregister the plugin and remove all event bindings.
I found that after deregister the videojs-contrib-ads plugin , The player's play event is still affected by the plugin.
So is there any way to clear the videojs-contrib-ads plugin?
Thx~
Calling deregisterPlugin()
will not clean up event handlers added by the plugin. To do that you will need to dispose the player by calling player.dispose()
. However, even doing this will not clean up the play middleware that this plugin creates, as that is added to the global videojs
instance and not the player. It is possible that calling dispose()
will accomplish what you need in your specific case, so I'd recommend trying that. To better assist you, it would also be helpful for us to understand why you are trying to deregister the plugin to begin with.