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

Is there any way to clear or deregister the videojs-contrib-ads plugin for removing event binding and such as? #559

Open
JonasWater opened this issue Jul 12, 2023 · 1 comment

Comments

@JonasWater
Copy link

JonasWater commented Jul 12, 2023

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~

@alex-barstow
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants