feat: 添加弹幕窗口管理功能;优化弹幕客户端连接逻辑;实现自动滚动和设置更新; 修复浏览页页面切换的问题

This commit is contained in:
2025-04-14 17:05:13 +08:00
parent c13fcb90c8
commit ff755afd99
11 changed files with 195 additions and 139 deletions

View File

@@ -102,7 +102,7 @@ export default abstract class BaseDanmakuClient {
const result = await this.initClient();
if (result.success) {
this.state = 'connected';
console.log(`[${this.type}] 弹幕客户端启动成功`);
console.log(`[${this.type}] 弹幕客户端已完成启动`);
} else {
this.state = 'disconnected';
console.error(`[${this.type}] 弹幕客户端启动失败: ${result.message}`);

View File

@@ -34,7 +34,7 @@ export default class DirectClient extends BaseDanmakuClient {
});
chatClient.on('live', () => {
console.log('[DIRECT] 已连接房间: ' + this.authInfo.roomId);
console.log('[direct] 已连接房间: ' + this.authInfo.roomId);
});
chatClient.on('DANMU_MSG', (data) => this.onDanmaku(data));
chatClient.on('SEND_GIFT', (data) => this.onGift(data));
@@ -45,7 +45,7 @@ export default class DirectClient extends BaseDanmakuClient {
return await super.initClientInner(chatClient);
} else {
console.log('[DIRECT] 无法开启场次, 未提供弹幕客户端认证信息');
console.log('[direct] 无法开启场次, 未提供弹幕客户端认证信息');
return {
success: false,
message: '未提供弹幕客户端认证信息'