mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 02:48:19 -07:00
Support async plugin loading from window
This commit is contained in:
parent
0a09062ad4
commit
00c6501dc8
@ -74,9 +74,14 @@ import { playbackManager } from './playback/playbackmanager';
|
||||
if (typeof pluginSpec === 'string') {
|
||||
if (pluginSpec in window) {
|
||||
console.log(`Loading plugin (via window): ${pluginSpec}`);
|
||||
let pluginInstance = await window[pluginSpec];
|
||||
|
||||
if (typeof pluginInstance === 'function') {
|
||||
pluginInstance = await pluginInstance();
|
||||
}
|
||||
|
||||
// init plugin and pass basic dependencies
|
||||
plugin = new window[pluginSpec]({
|
||||
plugin = new pluginInstance({
|
||||
events: Events,
|
||||
loading,
|
||||
appSettings,
|
||||
|
Loading…
Reference in New Issue
Block a user