chore: Reset danmuku queue and emit event on reset

This commit is contained in:
Harvey Zack committed 2024-05-27 11:47:31 +08:00
1 parent b2f2251c63
commit c7e91e3c8f
3 files changed
+6 -1

No files matched your search

@@ -572,6 +572,7 @@ export default class Danmuku {
reset() {
this.queue.forEach((danmu) => this.makeWait(danmu));
this.art.emit('artplayerPluginDanmuku:reset');
return this;
}
@@ -193,7 +193,7 @@ type Danmuku = {
/**
* 重置弹幕
*/
reset: () => void;
reset: () => Danmuku;
/**
* 弹幕配置
@@ -533,6 +533,10 @@ art.on('artplayerPluginDanmuku:show', () => {
console.info('弹幕显示');
});
art.on('artplayerPluginDanmuku:react', () => {
console.info('弹幕重置');
});
art.on('artplayerPluginDanmuku:destroy', () => {
console.info('弹幕销毁');
});