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

feat: move to advanced plugin and add reset API #224

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

wseymour15
Copy link
Contributor

Description

This will be a breaking change, and we will need this to be a major version bump
Since the user will no longer be able to reset the options with the player.overlay() functionality after moving to an advanced plugin, we now have the overlay.reset() function to do something similar.

These changes move the plugin from a function to an advanced plugin, giving the plugin lifecycle methods.

Specific Changes proposed

  • Move the plugin from a function to and advanced plugin class
  • Add a reset function to update the plugin options and reset the overlays.
  • Add an additional bundled file videojs-overlay.plugin.js to the dist so we have a way of importing this plugin class without registering/initializing it.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Unit Tests updated or fixed
    • Docs/guides updated
  • Reviewed by Two Core Contributors

src/plugin.js Outdated
import {version as VERSION} from '../package.json';
import initOverlayComponent from './overlay-component';

initOverlayComponent(videojs);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume we want this to be initialized in the index file, not here

Copy link
Contributor Author

@wseymour15 wseymour15 Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair. I guess we will still need a way to call initOverlayComponent in the plugin only scenario, so I also made a change to export that along with the plugin in the plugin-only bundle.

@wseymour15 wseymour15 merged commit 8524c38 into main Oct 28, 2024
@wseymour15 wseymour15 deleted the feat/extend-plugin-class-and-reset-functionality branch October 28, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants