mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -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() {
|
load() {
|
||||||
if (typeof this.option.danmuku === 'function') {
|
if (typeof this.option.danmuku === 'function') {
|
||||||
this.option.danmuku().then((danmus) => {
|
this.option.danmuku().then((danmus) => {
|
||||||
|
this.queue = [];
|
||||||
danmus.forEach(this.emit.bind(this));
|
danmus.forEach(this.emit.bind(this));
|
||||||
this.art.emit('artplayerPluginDanmuku:loaded');
|
this.art.emit('artplayerPluginDanmuku:loaded');
|
||||||
});
|
});
|
||||||
} else if (typeof this.option.danmuku === 'string') {
|
} else if (typeof this.option.danmuku === 'string') {
|
||||||
bilibiliDanmuParseFromUrl(this.option.danmuku).then((danmus) => {
|
bilibiliDanmuParseFromUrl(this.option.danmuku).then((danmus) => {
|
||||||
|
this.queue = [];
|
||||||
danmus.forEach(this.emit.bind(this));
|
danmus.forEach(this.emit.bind(this));
|
||||||
this.art.emit('artplayerPluginDanmuku:loaded');
|
this.art.emit('artplayerPluginDanmuku:loaded');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.queue = [];
|
||||||
this.option.danmuku.forEach(this.emit.bind(this));
|
this.option.danmuku.forEach(this.emit.bind(this));
|
||||||
this.art.emit('artplayerPluginDanmuku:loaded');
|
this.art.emit('artplayerPluginDanmuku:loaded');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user