mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
Update danmuku.js
This commit is contained in:
1 parent
39819c5b46
commit
b2f4bb4806
1 file changed
+3
@@ -56,17 +56,20 @@ export default class Danmuku {
|
|||||||
if (typeof this.option.danmuku === 'function') {
|
if (typeof this.option.danmuku === 'function') {
|
||||||
this.option.danmuku().then((danmus) => {
|
this.option.danmuku().then((danmus) => {
|
||||||
this.queue = [];
|
this.queue = [];
|
||||||
|
this.$danmuku.innerText = '';
|
||||||
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 = [];
|
this.queue = [];
|
||||||
|
this.$danmuku.innerText = '';
|
||||||
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.queue = [];
|
||||||
|
this.$danmuku.innerText = '';
|
||||||
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