Update danmuku.js

This commit is contained in:
zhw2590582 committed 2020-11-23 20:28:04 +08:00
1 parent 360c3179ae
commit b8c7e7b48b
1 file changed
+3
@@ -55,15 +55,18 @@ export default class Danmuku {
load() {
if (typeof this.option.danmuku === 'function') {
this.option.danmuku().then((danmus) => {
this.queue = [];
danmus.forEach(this.emit.bind(this));
this.art.emit('artplayerPluginDanmuku:loaded');
});
} else if (typeof this.option.danmuku === 'string') {
bilibiliDanmuParseFromUrl(this.option.danmuku).then((danmus) => {
this.queue = [];
danmus.forEach(this.emit.bind(this));
this.art.emit('artplayerPluginDanmuku:loaded');
});
} else {
this.queue = [];
this.option.danmuku.forEach(this.emit.bind(this));
this.art.emit('artplayerPluginDanmuku:loaded');
}