Skip to content

Commit

Permalink
fix(loader): log a warning message when loading plugins without versi…
Browse files Browse the repository at this point in the history
…on information from options

The warning message was being displayed when the plugins are registered, but not when they were loading from the option  for a given player instance.
  • Loading branch information
towerz committed Oct 16, 2019
1 parent e0175cf commit 47e11ff
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/components/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,20 @@ export default (() => {
*/
addExternalPlugins(plugins) {
plugins = this.groupPluginsByType(plugins)
if (plugins.playback)
this.playbackPlugins = this.removeDups(plugins.playback.concat(this.playbackPlugins))
if (plugins.playback) {
const playbacks = plugins.playback.filter((playback) => (Loader.checkVersionSupport(playback), true))
this.playbackPlugins = this.removeDups(playbacks.concat(this.playbackPlugins))
}

if (plugins.container)
this.containerPlugins = this.removeDups(plugins.container.concat(this.containerPlugins))
if (plugins.container) {
const containerPlugins = plugins.container.filter((plugin) => (Loader.checkVersionSupport(plugin), true))
this.containerPlugins = this.removeDups(containerPlugins.concat(this.containerPlugins))
}

if (plugins.core)
this.corePlugins = this.removeDups(plugins.core.concat(this.corePlugins))
if (plugins.core) {
const corePlugins = plugins.core.filter((plugin) => (Loader.checkVersionSupport(plugin), true))
this.corePlugins = this.removeDups(corePlugins.concat(this.corePlugins))
}
}

/**
Expand Down

0 comments on commit 47e11ff

Please sign in to comment.