@trtc/calls-uikit-vue 4.2.2-beta.1 → 4.2.3

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.
Files changed (30) hide show
  1. package/package.json +2 -2
  2. package/src/TUICallService/CallService/chatCombine.ts +0 -20
  3. package/src/TUICallService/CallService/index.ts +25 -1
  4. package/src/index.ts +1 -1
  5. package/stats.html +1 -1
  6. package/tuicall-uikit-vue.es.js +995 -990
  7. package/tuicall-uikit-vue.umd.js +1 -1
  8. package/types/Components/components/SingleCall/hooks/useGetLargeViewName.d.ts +1 -1
  9. package/types/Components/components/base/Message/Message.d.ts +6 -6
  10. package/types/Components/components/common/Button/hooks/useConfig.d.ts +1 -1
  11. package/types/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.d.ts +2 -2
  12. package/types/Components/components/common/Swiper/useSlide.d.ts +2 -2
  13. package/types/Components/hooks/useCallDuration.d.ts +1 -1
  14. package/types/Components/hooks/useCustomUI.d.ts +1 -1
  15. package/types/Components/hooks/useCustomUIButtonConfig.d.ts +1 -1
  16. package/types/Components/hooks/useDeviceList.d.ts +2 -2
  17. package/types/Components/hooks/useFocusContext.d.ts +1 -1
  18. package/types/Components/hooks/useGetVolumeMap.d.ts +1 -1
  19. package/types/Components/hooks/useGroupCallLayout.d.ts +1 -1
  20. package/types/Components/hooks/useIsClickableContext.d.ts +1 -1
  21. package/types/Components/hooks/useJoinGroupCall.d.ts +7 -7
  22. package/types/Components/hooks/useNetWorkStatus.d.ts +1 -1
  23. package/types/Components/hooks/usePlayer.d.ts +1 -1
  24. package/types/Components/hooks/usePopover.d.ts +1 -1
  25. package/types/Components/hooks/useTip.d.ts +3 -3
  26. package/types/Components/hooks/useTranslate.d.ts +1 -1
  27. package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -1
  28. package/types/TUICallService/CallService/index.d.ts +5 -0
  29. package/types/TUICallService/utils/timer.d.ts +1 -1
  30. package/types/tsconfig.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trtc/calls-uikit-vue",
3
- "version": "4.2.2-beta.1",
3
+ "version": "4.2.3",
4
4
  "main": "./tuicall-uikit-vue.umd.js",
5
5
  "module": "./tuicall-uikit-vue.es.js",
6
6
  "types": "./types/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@tencentcloud/lite-chat": "^1.5.0",
17
17
  "@tencentcloud/tui-core-lite": "1.0.0",
18
- "@trtc/call-engine-lite-js": "~3.4.0"
18
+ "@trtc/call-engine-lite-js": "~3.4.5"
19
19
  },
20
20
  "bugs": {
21
21
  "url": "https://github.com/tencentyun/TUICallKit/issues"
@@ -275,19 +275,8 @@ export default class ChatCombine {
275
275
  */
276
276
  private async _handleTUICoreOnClick(options, type: CallMediaType) {
277
277
  try {
278
- // const isForceUseV2API = TUIStore.getData(StoreName.CALL, NAME.IS_FORCE_USE_V2_API);
279
278
  const { groupID, userIDList = [], version = '', ...rest } = options;
280
279
 
281
- // if (isForceUseV2API) {
282
- // await this._useV2API({ ...options, type });
283
- // return;
284
- // }
285
- // if (version === 'v3') {
286
- // await this._callService?.calls({ chatGroupID: groupID, userIDList, type, ...rest });
287
- // return;
288
- // }
289
- // await this._useV2API({ ...options, type });
290
-
291
280
  await this._callService?.calls({ chatGroupID: groupID, userIDList, type, ...rest });
292
281
  } catch (error: any) {
293
282
  // call update to lite-chat only support calls interface
@@ -297,15 +286,6 @@ export default class ChatCombine {
297
286
  console.debug(error);
298
287
  }
299
288
  }
300
- // private async _useV2API(options) {
301
- // const { groupID, userIDList = [], type, ...rest } = options || {};
302
-
303
- // if (groupID) {
304
- // await this._callService?.groupCall({ groupID, userIDList, type, ...rest });
305
- // } else if (userIDList.length === 1) {
306
- // await this._callService?.call({ userID: userIDList[0], type, ...rest });
307
- // }
308
- // }
309
289
  private async _handleGroupAttributesUpdated(event) {
310
290
  if (TUIStore.getData(StoreName.CALL, NAME.CALL_STATUS) !== CallStatus.IDLE) return;
311
291
 
@@ -26,7 +26,7 @@ const TUIGlobal: ITUIGlobal = TuiGlobal.getInstance();
26
26
  const TUIStore: ITUIStore = TuiStore.getInstance();
27
27
  const uiDesign = UIDesign.getInstance();
28
28
  uiDesign.setTUIStore(TUIStore);
29
- const version = '4.2.2-beta.1';
29
+ const version = '4.2.3';
30
30
  const frameWork = 'vue3';
31
31
  export { TUIGlobal, TUIStore, uiDesign };
32
32
 
@@ -44,9 +44,17 @@ export default class TUICallService {
44
44
  private _permissionCheckTimer: any = null;
45
45
  private _chatCombine: any = null;
46
46
  private _engineEventHandler: any = null;
47
+ // wasm ready
48
+ private _wasmReadyPromise;
49
+ private _wasmReadyResolve;
50
+ private _isInitialized = false;
47
51
 
48
52
  constructor() {
49
53
  console.log(`${NAME.PREFIX}version: ${version}`);
54
+ this._wasmReadyPromise = new Promise(resolve => {
55
+ this._wasmReadyResolve = resolve;
56
+ });
57
+ this._loadWasm();
50
58
  this._watchTUIStore();
51
59
  this._engineEventHandler = EngineEventHandler.getInstance({ callService: this });
52
60
 
@@ -59,8 +67,23 @@ export default class TUICallService {
59
67
  }
60
68
  return TUICallService.instance;
61
69
  }
70
+ public _loadWasm() {
71
+ TUICallEngine.once('ready', () => this._wasmReadyResolve());
72
+ }
62
73
  @avoidRepeatedCall()
63
74
  public async init(params: IInitParams) {
75
+ if (this._isInitialized) {
76
+ console.warn('TUICallKit has already been initialized.');
77
+ return;
78
+ }
79
+ await this._wasmReadyPromise;
80
+
81
+ if (!this._isInitialized) {
82
+ this._doInit(params);
83
+ this._isInitialized = true;
84
+ }
85
+ }
86
+ public async _doInit(params: IInitParams) {
64
87
  try {
65
88
  if (this._tuiCallEngine) return;
66
89
  // @ts-ignore
@@ -109,6 +132,7 @@ export default class TUICallService {
109
132
  // component destroy
110
133
  public async destroyed() {
111
134
  try {
135
+ this._isInitialized = false;
112
136
  const currentCallStatus = TUIStore.getData(StoreName.CALL, NAME.CALL_STATUS);
113
137
  if (currentCallStatus !== CallStatus.IDLE) {
114
138
  throw new Error(`please destroyed when status is idle, current status: ${currentCallStatus}`);
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ const TUICallType = {
37
37
  AUDIO_CALL: 1,
38
38
  VIDEO_CALL: 2,
39
39
  };
40
- const Version = '4.2.2-beta.1'; // basic-demo 原来上报使用
40
+ const Version = '4.2.3'; // basic-demo 原来上报使用
41
41
 
42
42
  // 输出产物
43
43
  export {