1. 1 : /**
  2. 2 : * @file plugins.js
  3. 3 : * @module plugins
  4. 4 : */
  5. 5 : import Player from './player.js';
  6. 6 :
  7. 7 : /**
  8. 8 : * The method for registering a video.js plugin. {@link videojs:videojs.registerPlugin].
  9. 9 : *
  10. 10 : * @param {string} name
  11. 11 : * The name of the plugin that is being registered
  12. 12 : *
  13. 13 : * @param {plugins:PluginFn} init
  14. 14 : * The function that gets run when a `Player` initializes.
  15. 15 : */
  16. 16 : const plugin = function(name, init) {
  17. 17 : Player.prototype[name] = init;
  18. 18 : };
  19. 19 :
  20. 20 : export default plugin;