@xmov/avatar 2.0.0-beta.14 → 2.0.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export {};
@@ -118,6 +118,15 @@ export default class RenderScheduler {
118
118
  next_state: string;
119
119
  };
120
120
  sendVoiceEnd(): void;
121
+ /**
122
+ * 重连成功恢复(含窗口内 socket.io 自动重连恢复、窗口外重开房间):
123
+ * 数据缓存在断网进入离线时已清空(_offlineMode/_offlineRun),此处仅恢复播放状态:
124
+ * - 标记帧号对齐:首个 BODY/AUDIO 数据到达时按 sf 重设帧时钟
125
+ * - 恢复音频播放
126
+ * - 解码器退出离线模式(重置 _offlineLastFrame、清空离线队列)
127
+ * 避免离线 idle 播放推进的帧号领先服务端续推数据导致人物卡死、音画不同步
128
+ */
129
+ markReconnectRecover(): void;
121
130
  _offlineMode(): void;
122
131
  _offlineRun(): void;
123
132
  ttsaStateChangeHandle(state: StateChangeInfo): void;
@@ -24,6 +24,7 @@ interface ITtsaOptions {
24
24
  enterOfflineMode: () => void;
25
25
  reStartSDK: () => void;
26
26
  reconnect_client_timeout: number;
27
+ reconnect_timeout: number;
27
28
  sendVoiceEnd: () => void;
28
29
  getCurrentFrameIndex: () => number;
29
30
  }
@@ -45,7 +46,9 @@ export default class Ttsa {
45
46
  private enterOfflineMode;
46
47
  private reStartSDK;
47
48
  private reconnect_client_timeout;
49
+ private reconnect_timeout;
48
50
  private reconnectTimer;
51
+ private socketReconnectTimer;
49
52
  private wsConnectTimer;
50
53
  private enterOfflineFlag;
51
54
  private sendVoiceEnd;
@@ -57,9 +60,13 @@ export default class Ttsa {
57
60
  private heartbeatTimer;
58
61
  private readonly HEARTBEAT_INTERVAL;
59
62
  /**
60
- * 清除WebSocket重连定时器
63
+ * 清除WebSocket重连定时器(含停止 socket.io 自动重连的定时器)
61
64
  */
62
65
  clearReconnectTimer(): void;
66
+ /**
67
+ * 清除停止 socket.io 自动重连的定时器
68
+ */
69
+ private clearSocketReconnectTimer;
63
70
  /**
64
71
  * 启动客户端心跳(每 2s 发送一次 client_heartbeat)
65
72
  */