@trtc/calls-uikit-react 4.2.5 → 4.4.2

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.
@@ -9,6 +9,7 @@ import {
9
9
  // @ts-ignore
10
10
  import { TUICallEngine } from '@trtc/call-engine-lite-js';
11
11
  import { checkLocalMP3FileExists } from '../utils/index';
12
+ import { handleModalError } from './UIKitModal';
12
13
  import { CallTips, t } from '../locales/index';
13
14
  import { BellContext } from './bellContext';
14
15
  import { avoidRepeatedCall } from '../utils/validate/index';
@@ -28,7 +29,7 @@ const TUIStore: ITUIStore = TuiStore.getInstance();
28
29
  const uiDesign = UIDesign.getInstance();
29
30
  uiDesign.setTUIStore(TUIStore);
30
31
  const aiAssistant = AIAssistant.getInstance();
31
- const version = '4.2.5';
32
+ const version = '4.4.2';
32
33
  const frameWork = 'react';
33
34
  export { TUIGlobal, TUIStore, uiDesign };
34
35
 
@@ -125,6 +126,11 @@ export default class TUICallService {
125
126
  this.enableAISubtitle(true);
126
127
  await this._tuiCallEngine.login({ userID, userSig, assetsPath: '' }); // web && mini
127
128
  const uiConfig = TUIStore.getData(StoreName.CALL, NAME.CUSTOM_UI_CONFIG);
129
+ // close auto play dialog
130
+ const trtcCloudInstance = this._tuiCallEngine?.getTRTCCloudInstance?.()
131
+ trtcCloudInstance?.callExperimentalAPI(JSON.stringify(
132
+ { "api": "enableAutoPlayDialog","params": { "enable": 0 } }
133
+ ));
128
134
  this._tuiCallEngine?.reportLog?.({
129
135
  name: 'TUICallkit.init',
130
136
  data: {
@@ -190,6 +196,7 @@ export default class TUICallService {
190
196
  const response = await this._tuiCallEngine.calls(callsParams);
191
197
  await this._updateCallStoreAfterCall(userIDList, response);
192
198
  } catch (error: any) {
199
+ handleModalError(error);
193
200
  this._handleCallError(error, 'calls');
194
201
  }
195
202
  }
@@ -224,6 +231,7 @@ export default class TUICallService {
224
231
  // setLocalUserInfoAudioVideoAvailable(true, NAME.VIDEO);
225
232
  // }
226
233
  } catch (error) {
234
+ handleModalError(error);
227
235
  this._handleCallError(error, 'join');
228
236
  }
229
237
  }
@@ -355,6 +363,7 @@ export default class TUICallService {
355
363
  error,
356
364
  });
357
365
  if (handleRepeatedCallError(error)) return;
366
+ handleModalError(error);
358
367
  noDevicePermissionToast(error, CallMediaType.AUDIO, this._tuiCallEngine);
359
368
  this._resetCallStore();
360
369
  }
@@ -370,6 +379,7 @@ export default class TUICallService {
370
379
  }
371
380
  });
372
381
  } catch (error) {
382
+ handleModalError(error);
373
383
  console.debug(error);
374
384
  }
375
385
  this._resetCallStore();
@@ -383,6 +393,7 @@ export default class TUICallService {
383
393
  this._chatCombine?.callTUIService({ message: response?.data?.message });
384
394
  }
385
395
  } catch (error) {
396
+ handleModalError(error);
386
397
  console.debug(error);
387
398
  }
388
399
  this._resetCallStore();
@@ -38,6 +38,7 @@ export const CALL_DATA_KEY: any = {
38
38
  GROUP_CALL_MEMBERS: 'groupCallMembers',
39
39
  PUSHER_ID: 'pusherId',
40
40
  IS_FORCE_USE_V2_API: 'isForceUseV2API',
41
+ MODAL_ERROR: 'modalError',
41
42
  };
42
43
 
43
44
  export const CHAT_DATA_KEY: any = {
@@ -66,6 +66,8 @@ export const en = {
66
66
  "The network is poor during your current call": "The network is poor during your current call",
67
67
  "The other user network is poor during the current call": "The other party's network is poor during the current call",
68
68
  "TUICallKit init is not complete": "TUICallKit init is not complete. You need to use this API after the init API is finished.",
69
+ "auto play failed": "Audio playback was blocked",
70
+ "click to resume": "Resume playback",
69
71
  // combine chat
70
72
  "Video call": "Video call",
71
73
  "Voice call": "Voice call",
@@ -132,4 +134,16 @@ export const en = {
132
134
  'accept-error': 'Accept failed',
133
135
  'accept-device-error': 'Accept failed, unable to auth calling device',
134
136
  'call-error': 'Start call failed',
137
+ // 错误提示
138
+ 'error.10001': "Your application has not enabled audio/video call (TUICallKit) capability. For first-time use, you can go to <a href='https://cloud.tencent.com/document/product/647/104662'>Enable Service</a> to apply for a free trial, or purchase call capability packages: <a href='https://console.cloud.tencent.com/trtc'>Purchase Page</a>",
139
+ 'error.10002': "You do not currently support using this capability. Please go to the <a href='https://buy.cloud.tencent.com/avc?addRavLicense=1&position=1600110000&ravLicenseType=1&regionId=1'>purchase page</a> to buy and activate it",
140
+ 'error.10004': "Camera/microphone permission was denied. Please check browser settings to ensure camera and microphone access is allowed. If you have confirmed permission is granted, please go to <a href='https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html'>Audio/Video Capability Detection</a> to check if your device and environment support calls",
141
+ 'error.10005': "No microphone device detected. Please ensure your device has a microphone connected and check if the microphone is available in system or browser settings.",
142
+ 'error.10006': "No camera device detected. Please ensure your camera is connected and check if the camera is available in system or browser settings.",
143
+ 'error.10007': "Current browser environment does not support WebRTC functionality. Please go to <a href='https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html'>Audio/Video Capability Detection</a> to check your device and environment compatibility",
144
+ 'error.10008': "TUICallEngine has not completed initialization or login. Please ensure you have successfully executed init or login operations before calling this function. Solution: <a href='https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887'>View Documentation</a>",
145
+ 'error.10012': "Detected that the current page is under HTTP protocol. To ensure smooth access and full functionality of TUICallEngine SDK for production environment users, please use HTTPS protocol (or localhost) to access the audio/video application page. For details, please visit: <a href='https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-05-info-browser.html#h2-3'>View Documentation</a>",
146
+ 'error.10013': "Call failed: You have been blocked by the other party or you have blocked the other party",
147
+ 'error.10014': "Call initiation failed. User ID is invalid. Please confirm that the user is registered.",
148
+ 'error': 'Error',
135
149
  };
@@ -77,6 +77,8 @@ export const ja_JP = {
77
77
  "The network is poor during your current call": "現在の通話で、あなたのネットワークは不良です",
78
78
  "The other user network is poor during the current call": "現在の通話で、相手側のネットワークが不良です",
79
79
  "TUICallKit init is not complete": "TUICallKitの初期化ログインが完了していません。init が完了した後にこのAPIを使用する必要があります。",
80
+ "auto play failed": "オーディオ再生がブロックされました",
81
+ "click to resume": "再生を再開",
80
82
  // 待废弃文案
81
83
  'timeout': '{{ userList }} タイムアウト',
82
84
  'kick out': 'キックアウトされました',
@@ -131,4 +133,16 @@ export const ja_JP = {
131
133
  'accept-error': '接続できませんでした',
132
134
  'accept-device-error': '接続できませんでした。発信側デバイスを認証できません',
133
135
  'call-error': '通話が開始できませんでした',
136
+ // 错误提示
137
+ 'error.10001': "あなたのアプリケーションは音声・ビデオ通話(TUICallKit)機能を有効にしていません。初めてご利用の場合、<a href='https://cloud.tencent.com/document/product/647/104662'>サービスを有効にする</a>で無料体験を申請するか、通話機能パッケージを購入してください:<a href='https://console.cloud.tencent.com/trtc'>購入ページ</a>",
138
+ 'error.10002': "現在この機能を使用することはできません。<a href='https://buy.cloud.tencent.com/avc?addRavLicense=1&position=1600110000&ravLicenseType=1&regionId=1'>購入ページ</a>で購入して有効にしてください",
139
+ 'error.10004': "カメラ/マイクのアクセス許可が拒否されました。ブラウザ設定を確認し、カメラとマイクの使用が許可されていることを確認してください。許可されている場合は、<a href='https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html'>音声・ビデオ機能検出</a>にアクセスして、お使いのデバイスと環境が通話をサポートしているか確認してください",
140
+ 'error.10005': "マイクデバイスが検出されませんでした。デバイスにマイクが接続されていることを確認し、システムまたはブラウザ設定でマイクが利用可能かどうかを確認してください。",
141
+ 'error.10006': "カメラデバイスが検出されませんでした。カメラが接続されていることを確認し、システムまたはブラウザ設定でカメラが利用可能かどうかを確認してください。",
142
+ 'error.10007': "現在のブラウザ環境はWebRTC機能をサポートしていません。<a href='https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html'>音声・ビデオ機能検出</a>にアクセスして、お使いのデバイスと環境の互換性を確認してください",
143
+ 'error.10008': "TUICallEngineが初期化またはログインを完了していません。この機能を呼び出す前に、initまたはlogin操作が正常に実行されていることを確認してください。解決策:<a href='https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887'>ドキュメントを確認</a>",
144
+ 'error.10012': "現在のページがHTTPプロトコル下にあることが検出されました。本番環境のユーザーがTUICallEngine SDKの全機能をスムーズに利用できるようにするため、音声・ビデオアプリケーションページにはHTTPSプロトコル(またはlocalhost)を使用してアクセスしてください。詳細については、<a href='https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-05-info-browser.html#h2-3'>ドキュメントを確認</a>してください",
145
+ 'error.10013': "通話失敗:相手にブロックされているか、または相手をブロックしています",
146
+ 'error.10014': "通話の開始に失敗しました。ユーザーIDが無効です。ユーザーが登録されていることを確認してください。",
147
+ 'error': 'エラー',
134
148
  };
@@ -66,6 +66,8 @@ export const zh = {
66
66
  "The network is poor during your current call": "当前通话你的网络不佳",
67
67
  "The other user network is poor during the current call": "当前通话对方网络不佳",
68
68
  "TUICallKit init is not complete": "TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API",
69
+ "auto play failed": "音频播放被拦截,请点击恢复播放",
70
+ "click to resume": "恢复播放",
69
71
  // combine chat
70
72
  "Video call": "发起视频通话",
71
73
  "Voice call": "发起语音通话",
@@ -127,4 +129,16 @@ export const zh = {
127
129
  'accept-error': '接通失败',
128
130
  'accept-device-error': '接通失败,通话设备获取失败',
129
131
  'call-error': '发起通话失败',
132
+ // 错误提示
133
+ 'error.10001': "您的应用还未开通音视频通话(TUICallKit)能力,首次使用,您可以去<a href='https://cloud.tencent.com/document/product/647/104662'>开通服务</a>申请免费体验,或购买通话能力套餐包:<a href='https://console.cloud.tencent.com/trtc'>购买页面</a>",
134
+ 'error.10002': "您暂不支持使用该能力,请前往<a href='https://buy.cloud.tencent.com/avc?addRavLicense=1&position=1600110000&ravLicenseType=1&regionId=1'>购买页</a>购买开通",
135
+ 'error.10004': "摄像头/麦克风权限被拒绝,请检查浏览器设置,确保已允许使用您的摄像头和麦克风。如果您确认已授予权限,请前往<a href='https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html'>音视频能力检测</a>检查您的设备和环境是否支持通话",
136
+ 'error.10005': "未检测到麦克风设备。请确保您的设备已连接麦克风,并检查系统或浏览器设置中麦克风是否可用。",
137
+ 'error.10006': "未检测到摄像头设备。请确保您的摄像头已连接,并检查系统或浏览器设置中摄像头是否可用。",
138
+ 'error.10007': "当前浏览器环境不支持 WebRTC 功能。请前往<a href='https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html'>音视频能力检测</a>检查您的设备和环境兼容性",
139
+ 'error.10008': "TUICallEngine 尚未完成初始化或登录。请确保在调用此功能前,已成功执行 init 或 login 操作。解决方案:<a href='https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887'>查看文档</a>",
140
+ 'error.10012': "检测到当前页面正处于 http 协议下,为确保生产环境用户顺畅接入和体验 TUICallEngine SDK 的全部功能,请使用 https 协议(或 localhost)访问音视频应用页面。详情请前往:<a href='https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-05-info-browser.html#h2-3'>查看文档</a>",
141
+ 'error.10013': "呼叫失败:您已被对方拉黑或您拉黑了对方",
142
+ 'error.10014': "发起通话失败,用户 ID 无效,请确认该用户已注册。",
143
+ 'error': '错误',
130
144
  };
@@ -143,7 +143,7 @@ export const retryPromise = (promise: Promise<any>, num: number = 6, time: numbe
143
143
  * @returns {Boolean}
144
144
  */
145
145
  export function handleRepeatedCallError(error: any) {
146
- if (error?.message.indexOf('is ongoing, please avoid repeated calls') !== -1) {
146
+ if (error?.message?.indexOf('is ongoing, please avoid repeated calls') !== -1) {
147
147
  return true;
148
148
  }
149
149
  return false;
package/src/index.ts CHANGED
@@ -35,7 +35,7 @@ const TUICallType = {
35
35
  AUDIO_CALL: 1,
36
36
  VIDEO_CALL: 2,
37
37
  };
38
- const Version = '4.2.5'; // basic-demo 原来上报使用
38
+ const Version = '4.4.2'; // basic-demo 原来上报使用
39
39
 
40
40
  // 输出产物
41
41
  export {