update plugin

This commit is contained in:
Harvey Zack committed 2018-10-11 17:17:14 +08:00
1 parent d5d16ed709
commit 5a59096f9b
1 file changed
+5 -1
+5 -1
View File
@@ -78,7 +78,11 @@ class Artplayer extends Emitter {
const args = Array.from(arguments).slice(1);
args.unshift(this);
plugin.apply(null, args);
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args);
} else if (typeof plugin === 'function') {
plugin.apply(null, args);
}
installedPlugins.push(plugin);
return this;
}