mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 05:26:15 -08:00
Update danmuku.js
This commit is contained in:
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');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user