@xmov/avatar 2.1.2 → 2.2.0
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.
- package/dist/agent/avatar.cjs +1 -1
- package/dist/agent/avatar.modern.js +1 -1
- package/dist/agent/avatar.module.js +1 -1
- package/dist/agent/avatar.umd.js +1 -1
- package/dist/agent/index.d.ts +5 -3
- package/dist/agent/types.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +8 -4
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -516,7 +516,11 @@ export default class XmovAvatar {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
async init(params: IInitParams): Promise<
|
|
519
|
+
async init(params: IInitParams): Promise<void> {
|
|
520
|
+
await this.initializeSession(params);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
protected async initializeSession(params: IInitParams): Promise<ISessionResponse | null | undefined> {
|
|
520
524
|
// 浏览器能力检查
|
|
521
525
|
const capabilityReport = await checkCapability(this.options.audioOnlyMode);
|
|
522
526
|
if (!capabilityReport.supported) {
|
|
@@ -1168,6 +1172,8 @@ export default class XmovAvatar {
|
|
|
1168
1172
|
}
|
|
1169
1173
|
|
|
1170
1174
|
protected start() {
|
|
1175
|
+
this.renderScheduler.render();
|
|
1176
|
+
this.ttsa?.start();
|
|
1171
1177
|
// 先发布在线状态,再启动渲染:
|
|
1172
1178
|
// 避免先 render() 触发 rendering -> visible(5) 后再发 online(0),造成 0/5 状态横跳
|
|
1173
1179
|
if (this.pendingInvisibleMode) {
|
|
@@ -1178,9 +1184,6 @@ export default class XmovAvatar {
|
|
|
1178
1184
|
// 避免重连重建房间过程中(资源未下载完)反复触发 online -> visible 状态横跳
|
|
1179
1185
|
this.onStatusChange(AvatarStatus.online);
|
|
1180
1186
|
}
|
|
1181
|
-
this.renderScheduler.render();
|
|
1182
|
-
this.ttsa?.start();
|
|
1183
|
-
|
|
1184
1187
|
}
|
|
1185
1188
|
|
|
1186
1189
|
protected onTtsaReady(_sessionInfo?: ISessionResponse) {
|
|
@@ -1590,6 +1593,7 @@ export default class XmovAvatar {
|
|
|
1590
1593
|
* 切换隐身模式(暂停/恢复音视频实时渲染)
|
|
1591
1594
|
*/
|
|
1592
1595
|
public switchInvisibleMode(): void {
|
|
1596
|
+
console.log("")
|
|
1593
1597
|
if (this._isClientMode) { this._apiForwarder?.switchInvisibleMode(); return; }
|
|
1594
1598
|
if (!this.renderScheduler) {
|
|
1595
1599
|
(window as any).avatarSDKLogger?.warn(
|