@tencentcloud/call-uikit-vue
Advanced tools
Comparing version 1.3.2 to 1.3.3
{ | ||
"name": "@tencentcloud/call-uikit-vue", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"main": "./src/index.ts", | ||
@@ -36,9 +36,10 @@ "description": "An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.", | ||
], | ||
"eslintIgnore": ["./src"], | ||
"dependencies": { | ||
"aegis-web-sdk": "^1.36.4", | ||
"tim-js-sdk": "^2.24.1", | ||
"trtc-js-sdk": "^4.14.6", | ||
"tsignaling": "^1.0.1", | ||
"tuicall-engine-webrtc": "^1.2.1" | ||
"aegis-web-sdk": "^1.36.5", | ||
"tim-js-sdk": "^2.25.0", | ||
"trtc-js-sdk": "^4.15.1", | ||
"tsignaling": "^1.0.3", | ||
"tuicall-engine-webrtc": "^1.3.1" | ||
} | ||
} |
<h1 align="center"> TUICallKit </h1> | ||
<p align="center"> | ||
<img src="https://camo.githubusercontent.com/0091fcbb836af00ee2e2a10ccb667f56c737e1dd85d3d9adb1d6096812bcfb81/68747470733a2f2f67772e616c697061796f626a656374732e636f6d2f7a6f732f616e7466696e63646e2f5238734e253234474e6468362f6c616e67756167652e737667" style="width: 16px;"> | ||
<b> English </b> | <a href="https://github.com/tencentyun/TUICallKit/blob/main/Web/README.zh-CN.md"> 简体中文 </a> | ||
@@ -6,0 +5,0 @@ </p> |
export const STATUS = { | ||
IDLE: 'idle', | ||
BE_INVITED: 'be-invited', | ||
DIALING_C2C: 'dialing-c2c', | ||
DIALING_GROUP: 'dialing-group', | ||
CALLING_C2C_AUDIO: 'calling-c2c-audio', | ||
CALLING_C2C_VIDEO: 'calling-c2c-video', | ||
CALLING_GROUP_AUDIO: 'calling-group-audio', | ||
CALLING_GROUP_VIDEO: 'calling-group-video', | ||
IDLE: "idle", | ||
BE_INVITED: "be-invited", | ||
DIALING_C2C: "dialing-c2c", | ||
DIALING_GROUP: "dialing-group", | ||
CALLING_C2C_AUDIO: "calling-c2c-audio", | ||
CALLING_C2C_VIDEO: "calling-c2c-video", | ||
CALLING_GROUP_AUDIO: "calling-group-audio", | ||
CALLING_GROUP_VIDEO: "calling-group-video", | ||
} as const; | ||
export const CHANGE_STATUS_REASON = { | ||
REJECT: 'change-status-because-of-rejected', | ||
NO_RESPONSE: 'change-status-because-of-no-response', | ||
LINE_BUSY: 'change-status-because-of-line-busy', | ||
CALLING_CANCEL: 'change-status-because-of-calling-cancel', | ||
CALLING_TIMEOUT: 'change-status-because-of-calling-timeout', | ||
CALL_TYPE_CHANGED: ' call-type-changed', | ||
REJECT: "change-status-because-of-rejected", | ||
NO_RESPONSE: "change-status-because-of-no-response", | ||
LINE_BUSY: "change-status-because-of-line-busy", | ||
CALLING_CANCEL: "change-status-because-of-calling-cancel", | ||
CALLING_TIMEOUT: "change-status-because-of-calling-timeout", | ||
CALL_TYPE_CHANGED: " call-type-changed", | ||
} as const; | ||
export const CALL_TYPE_STRING = { | ||
VIDEO: 'call-type-string-video', | ||
AUDIO: 'call-type-string-audio', | ||
VIDEO: "call-type-string-video", | ||
AUDIO: "call-type-string-audio", | ||
} as const; |
@@ -0,5 +1,6 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import Server from "./server"; | ||
import TUICallKit from "./components/TUICallKit.vue"; | ||
import TUICallKitMini from "./components/TUICallKitMini.vue"; | ||
import { STATUS } from "./constants" | ||
import { STATUS } from "./constants"; | ||
@@ -9,4 +10,4 @@ const TUICallKitServer = new Server(); | ||
const plugin = (TUICore: any) => { | ||
TUICore.component('TUICallKit', { server: TUICallKitServer }); | ||
TUICore.component('TUICallKitMini', { server: TUICallKitServer }); | ||
TUICore.component("TUICallKit", { server: TUICallKitServer }); | ||
TUICore.component("TUICallKitMini", { server: TUICallKitServer }); | ||
TUICallKitServer.bindTUICore(TUICore); | ||
@@ -17,4 +18,4 @@ return TUICallKit; | ||
const install = (app: any) => { | ||
app.component('TUICallKitMini', TUICallKitMini); | ||
app.component('TUICallKit', TUICallKit); | ||
app.component("TUICallKitMini", TUICallKitMini); | ||
app.component("TUICallKit", TUICallKit); | ||
console.log("TUICallKit&mini installed", app); | ||
@@ -21,0 +22,0 @@ }; |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export interface TUIInitParam { | ||
@@ -6,2 +7,3 @@ SDKAppID: number; | ||
userSig: string; | ||
assetsPath?: string; | ||
} | ||
@@ -29,2 +31,3 @@ | ||
offlinePushInfo?: offlinePushInfoType; | ||
roomID?: number | ||
} | ||
@@ -35,5 +38,6 @@ | ||
isEntered: boolean; | ||
isReadyRender: boolean; | ||
microphone?: boolean; | ||
camera?: boolean; | ||
volume?: number; | ||
[key: string]: string | boolean | undefined; | ||
} | ||
@@ -40,0 +44,0 @@ |
@@ -1,5 +0,2 @@ | ||
// const en = require('./lang/en.json'); | ||
// const zh = require('./lang/zh.json'); | ||
const languageData: any = { | ||
export const languageData: languageDataType = { | ||
en: { | ||
@@ -52,3 +49,3 @@ "call": "call", | ||
"is-already-calling": "TUICallKit is already on a call", | ||
"need-init": "TUICallKit initialization is required before initiating a call", | ||
"need-init": "Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ", | ||
"can't call yourself": "Can't call yourself" | ||
@@ -103,8 +100,13 @@ }, | ||
"is-already-calling": "TUICallKit 已在通话状态", | ||
"need-init": "TUICallKit 发起通话前需先进行初始化", | ||
"need-init": "TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功", | ||
"can't call yourself": "不能呼叫自己" | ||
} | ||
}; | ||
interface languageItemType { | ||
[key: string]: string; | ||
} | ||
export default languageData; | ||
interface languageDataType { | ||
[key: string]: languageItemType; | ||
} |
@@ -0,4 +1,5 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { TUICallEngine, TUICallEvent, TUICallType } from "tuicall-engine-webrtc"; | ||
import type { TUICallParam, TUIInitParam, TUIGroupCallParam, RemoteUser, CallbackParam, offlinePushInfoType, statusChangedReturnType } from "./interface"; | ||
import type { TUICallParam, TUIInitParam, TUIGroupCallParam, RemoteUser, CallbackParam, statusChangedReturnType } from "./interface"; | ||
import { | ||
@@ -21,5 +22,7 @@ t, | ||
changeRemoteDeviceByUserID, | ||
changeIsMinimized | ||
} from './store'; | ||
import { STATUS, CHANGE_STATUS_REASON, CALL_TYPE_STRING } from './constants'; | ||
makeRenderFlag, | ||
changeIsMinimized, | ||
remoteList | ||
} from "./store"; | ||
import { STATUS, CHANGE_STATUS_REASON, CALL_TYPE_STRING } from "./constants"; | ||
import logReporter from "./utils/aegis"; | ||
@@ -30,3 +33,2 @@ | ||
* | ||
* TUIGroup 逻辑主体 | ||
*/ | ||
@@ -60,3 +62,4 @@ export default class TUICallKit { | ||
let { SDKAppID, tim } = params; | ||
const { userID, userSig } = params; | ||
const { userID, userSig, assetsPath } = params; | ||
if (this.TUICore) { | ||
@@ -68,6 +71,5 @@ SDKAppID = this.TUICore.SDKAppID; | ||
try { | ||
if (this.tuiCallEngine) await this.tuiCallEngine.destroyInstance(); | ||
this.tuiCallEngine = TUICallEngine.createInstance({ SDKAppID, tim }); | ||
this.bindTIMEvent(); | ||
await this.tuiCallEngine.login({ userID, userSig }); | ||
await this.tuiCallEngine.login({ userID, userSig, assetsPath }); | ||
updateProfile(Object.assign(profile.value, { userID })); | ||
@@ -83,3 +85,2 @@ console.log("TUICallKit login successful"); | ||
} catch (error: any) { | ||
console.error("TUICallKit login failed", JSON.stringify(error)); | ||
if (this.TUICore) { | ||
@@ -92,2 +93,3 @@ logReporter.loginWithTUICoreFailed(SDKAppID, JSON.stringify(error)); | ||
} | ||
console.error("TUICallKit login failed", JSON.stringify(error)); | ||
throw new Error(error); | ||
@@ -117,6 +119,6 @@ } | ||
try { | ||
const res = await this.tuiCallEngine.call({ userID, type, timeout, offlinePushInfo }); | ||
await this.tuiCallEngine.call({ userID, type, timeout, offlinePushInfo }); | ||
this.beforeCalling && this.beforeCalling("call"); | ||
changeStatus(STATUS.DIALING_C2C); | ||
changeRemoteList([{ userID, isEntered: false, microphone: false, camera: false }]); | ||
changeRemoteList([{ userID, isEntered: false, isReadyRender: false }]); | ||
changeCallType(type); | ||
@@ -127,9 +129,9 @@ changeIsFromGroup(false); | ||
if (this.error && this.beforeCalling) { | ||
this.beforeCalling("call", this.error); | ||
this.beforeCalling("call", this.error); | ||
} | ||
this.error = null; | ||
this.callingAPIMutex = ""; | ||
console.error("TUICallKit call error: " + JSON.stringify(error)); | ||
changeStatus(STATUS.IDLE); | ||
logReporter.callFailed(this.SDKAppID, "call", type === 1 ? "audio" : "video", JSON.stringify(error)); | ||
console.error("TUICallKit call error: " + JSON.stringify(error)); | ||
throw new Error(error); | ||
@@ -158,9 +160,9 @@ } | ||
this.checkStatus(); | ||
const { userIDList, type, groupID, timeout, offlinePushInfo } = params; | ||
const { userIDList, type, groupID, timeout, offlinePushInfo, roomID } = params; | ||
try { | ||
await this.tuiCallEngine.groupCall({ userIDList, type, groupID, timeout, offlinePushInfo }); | ||
await this.tuiCallEngine.groupCall({ userIDList, type, groupID, timeout, offlinePushInfo, roomID }); | ||
this.beforeCalling && this.beforeCalling("groupCall"); | ||
const newRemoteList: Array<RemoteUser> = []; | ||
userIDList.forEach((userID: string) => { | ||
newRemoteList.push({ userID, isEntered: false, microphone: false, camera: false }); | ||
newRemoteList.push({ userID, isEntered: false, isReadyRender: false }); | ||
}); | ||
@@ -174,8 +176,8 @@ changeRemoteList(newRemoteList); | ||
if (this.error && this.beforeCalling) { | ||
this.beforeCalling("groupCall", this.error); | ||
this.beforeCalling("groupCall", this.error); | ||
} | ||
this.error = null; | ||
this.callingAPIMutex = ""; | ||
logReporter.callFailed(this.SDKAppID, "groupCall", type === 1 ? "audio" : "video", JSON.stringify(error)); | ||
console.error("TUICallKit groupCall error: " + JSON.stringify(error)); | ||
logReporter.callFailed(this.SDKAppID, "groupCall", type === 1 ? "audio" : "video", JSON.stringify(error)); | ||
throw new Error(error); | ||
@@ -185,8 +187,22 @@ } | ||
public async joinInGroupCall(params: any) { | ||
const { roomID, type, groupID } = params; | ||
await this.tuiCallEngine.joinInGroupCall({ roomID, type, groupID }); | ||
this.beforeCalling && this.beforeCalling("groupCall"); | ||
changeStatus(STATUS.DIALING_GROUP); | ||
changeCallType(type); | ||
changeIsFromGroup(true); | ||
this.getIntoCallingStatus(); | ||
logReporter.callSuccess(this.SDKAppID, "groupCall", type === 1 ? "audio" : "video"); | ||
} | ||
private checkStatus() { | ||
if (status.value !== STATUS.IDLE) { | ||
throw new Error(t('is-already-calling')); | ||
console.error("TUICallKit groupCall error:", t("is-already-calling")); | ||
throw new Error(t("is-already-calling")); | ||
} | ||
if (!this.tuiCallEngine) { | ||
throw new Error(t('need-init')); | ||
console.error("TUICallKit groupCall error:", t("need-init")); | ||
throw new Error(t("need-init")); | ||
} | ||
@@ -223,3 +239,3 @@ } | ||
if (language !== "en" && language !== "zh-cn") { | ||
console.warn("TUICallKit change language warning: ", `${language} in not supported, has changed to default English`); | ||
console.log("TUICallKit change language warning: ", `${language} in not supported, has changed to default English`); | ||
language = "en"; | ||
@@ -269,2 +285,3 @@ } | ||
public async startLocalView(local: string) { | ||
console.log("TUICallKit startLocalView"); | ||
await this.tuiCallEngine.startLocalView({ userID: profile.value.userID, videoViewDomID: local }); | ||
@@ -278,2 +295,3 @@ } | ||
public async startRemoteView(userID: string) { | ||
console.log("TUICallKit startRemoteView", userID); | ||
await this.tuiCallEngine.startRemoteView({ userID, videoViewDomID: userID }); | ||
@@ -353,4 +371,32 @@ } | ||
// open/close AI noise reduction | ||
public async enableAIVoice(enable: boolean) { | ||
try { | ||
this.tuiCallEngine.enableAIVoice(enable); | ||
console.log("TUICallKit enableAIVoice:", enable); | ||
} catch (error: any) { | ||
console.error("TUICallKit enableAIVoice failed", error.message); | ||
} | ||
} | ||
// inviteUser | ||
public async inviteUser(params: any) { | ||
const { userIDList = [] } = params; | ||
console.log("TUICallKit inviteUser", params); | ||
try { | ||
const res = this.tuiCallEngine && await this.tuiCallEngine.inviteUser(params); | ||
const newRemoteList: Array<RemoteUser> = remoteList.value; | ||
userIDList.forEach((userID: string) => { | ||
newRemoteList.push({ userID, isEntered: false, isReadyRender: false }); | ||
}); | ||
changeRemoteList(newRemoteList); | ||
console.log("TUICallKit inviteUser success: ", res); | ||
} catch (error: any) { | ||
console.error("TUICallKit inviteUser error: " + JSON.stringify(error)); | ||
throw new Error(error); | ||
} | ||
} | ||
/** | ||
* 组件销毁 | ||
* component destroyed | ||
*/ | ||
@@ -360,3 +406,3 @@ public async destroyed() { | ||
changeStatus(STATUS.IDLE); | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
try { | ||
@@ -381,3 +427,3 @@ if (this.tuiCallEngine) await this.tuiCallEngine.destroyInstance(); | ||
* // | ||
* // TUICallEngine 事件监听注册接口 | ||
* // TUICallEngine listener | ||
* // | ||
@@ -437,25 +483,25 @@ * ///////////////////////////////////////////////////////////////////////////////// | ||
switch (code) { | ||
case 60001: | ||
this.error.type = t('method-call-failed'); | ||
this.error.message = `switchToAudioCall ${t('call-failed')}`; | ||
case 60001: | ||
this.error.type = t("method-call-failed"); | ||
this.error.message = `switchToAudioCall ${t("call-failed")}`; | ||
break; | ||
case 60002: | ||
this.error.type = t('method-call-failed'); | ||
this.error.message = `switchToVideoCall ${t('call-failed')}`; | ||
this.error.type = t("method-call-failed"); | ||
this.error.message = `switchToVideoCall ${t("call-failed")}`; | ||
break; | ||
case 60003: | ||
this.error.type = t('failed-to-obtain-permission'); | ||
this.error.message = t('microphone-unavailable'); | ||
this.error.type = t("failed-to-obtain-permission"); | ||
this.error.message = t("microphone-unavailable"); | ||
break; | ||
case 60004: | ||
this.error.type = t('failed-to-obtain-permission'); | ||
this.error.message = t('camera-unavailable'); | ||
this.error.type = t("failed-to-obtain-permission"); | ||
this.error.message = t("camera-unavailable"); | ||
break; | ||
case 60005: | ||
this.error.type = t('failed-to-obtain-permission'); | ||
this.error.message = t('ban-device'); | ||
this.error.type = t("failed-to-obtain-permission"); | ||
this.error.message = t("ban-device"); | ||
break; | ||
case 60006: | ||
this.error.type = t('environment-detection-failed'); | ||
this.error.message = t('not-supported-webrtc'); | ||
this.error.type = t("environment-detection-failed"); | ||
this.error.message = t("not-supported-webrtc"); | ||
break; | ||
@@ -474,3 +520,3 @@ } | ||
private handleKickedOut() { | ||
private handleKickedOut(event: any) { | ||
console.error("TUICallKit Kicked Out", JSON.stringify(event)); | ||
@@ -480,3 +526,5 @@ } | ||
private handleUserVideoAvailable(event: any) { | ||
console.log("TUICallKit handleUserVideoAvailable", event); | ||
const { userID, isVideoAvailable } = event; | ||
makeRenderFlag("isReadyRender", userID); | ||
changeRemoteDeviceByUserID(userID, CALL_TYPE_STRING.VIDEO, isVideoAvailable); | ||
@@ -486,2 +534,3 @@ } | ||
private handleUserAudioAvailable(event: any) { | ||
console.log("TUICallKit handleUserAudioAvailable", event); | ||
const { userID, isAudioAvailable } = event; | ||
@@ -507,4 +556,4 @@ changeRemoteDeviceByUserID(userID, CALL_TYPE_STRING.AUDIO, isAudioAvailable); | ||
changeStatus(STATUS.BE_INVITED); | ||
this.callingAPIMutex = 'be_invited'; | ||
changeRemoteList([{ userID: sponsor, isEntered: false }]); | ||
this.callingAPIMutex = "be_invited"; | ||
changeRemoteList([{ userID: sponsor, isEntered: false, isReadyRender: false }]); | ||
changeCallType(callType); | ||
@@ -545,3 +594,3 @@ changeIsFromGroup(isFromGroup); | ||
changeStatus(STATUS.IDLE, CHANGE_STATUS_REASON.REJECT, 1000); | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
} | ||
@@ -555,3 +604,3 @@ | ||
changeStatus(STATUS.IDLE, CHANGE_STATUS_REASON.NO_RESPONSE, isFromGroup.value ? 0 : 1000); | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
} | ||
@@ -567,3 +616,3 @@ }); | ||
} | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
} | ||
@@ -574,3 +623,3 @@ | ||
changeStatus(STATUS.IDLE, CHANGE_STATUS_REASON.CALLING_CANCEL, 1000); | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
} | ||
@@ -584,3 +633,3 @@ | ||
changeStatus(STATUS.IDLE, CHANGE_STATUS_REASON.CALLING_TIMEOUT, isFromGroup.value ? 0 : 1000); | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
} | ||
@@ -593,3 +642,3 @@ }); | ||
changeStatus(STATUS.IDLE); | ||
this.callingAPIMutex = ''; | ||
this.callingAPIMutex = ""; | ||
} | ||
@@ -605,5 +654,5 @@ | ||
const message = event?.data; | ||
console.log('TUICallKit MessageSentByMe', message); | ||
console.log("TUICallKit MessageSentByMe", message); | ||
this.onMessageSentByMe && this.onMessageSentByMe(message); | ||
} | ||
} |
@@ -1,8 +0,8 @@ | ||
import { ref, watch } from 'vue'; | ||
import type { RemoteUser } from '../interface'; | ||
import { timerStart, timerClear, timerString } from '../utils/timer'; | ||
import { STATUS, CHANGE_STATUS_REASON, CALL_TYPE_STRING } from '../constants'; | ||
import { TUICallType } from 'tuicall-engine-webrtc'; | ||
import { TUICallKitServer } from '../index'; | ||
import languageData from '../locales/index'; | ||
import { ref, watch } from "vue"; | ||
import type { RemoteUser } from "../interface"; | ||
import { timerStart, timerClear, timerString } from "../utils/timer"; | ||
import { STATUS, CHANGE_STATUS_REASON, CALL_TYPE_STRING } from "../constants"; | ||
import { TUICallType } from "tuicall-engine-webrtc"; | ||
import { TUICallKitServer } from "../index"; | ||
import { languageData } from "../locales/index"; | ||
@@ -17,8 +17,9 @@ const lang = ref<string>("zh-cn"); | ||
const remoteList = ref<Array<RemoteUser>>([]); | ||
const volumeMap = ref<Map<string, number>>(new Map<string, number>()); | ||
const profile = ref<RemoteUser>({ | ||
userID: "not login", | ||
userID: "", | ||
isEntered: true, | ||
isReadyRender: false, | ||
microphone: true, | ||
camera: true, | ||
volume: 0 | ||
}); | ||
@@ -32,8 +33,8 @@ | ||
if (status.value === STATUS.BE_INVITED) { | ||
changeDialingInfo(callType.value === CALL_TYPE_STRING.AUDIO ? t('start-voice-call') : t('start-video-call')); | ||
changeDialingInfo(callType.value === CALL_TYPE_STRING.AUDIO ? t("start-voice-call") : t("start-video-call")); | ||
} | ||
if (status.value.split('-')[0] === "dialing") { | ||
changeDialingInfo(t('waiting')); | ||
if (status.value.split("-")[0] === "dialing") { | ||
changeDialingInfo(t("waiting")); | ||
} | ||
if (status.value.split('-')[0] === "calling") { | ||
if (status.value.split("-")[0] === "calling") { | ||
changeDialingInfo(""); | ||
@@ -56,7 +57,8 @@ timerStart(); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function t(key: any): string { | ||
for(let langKey in languageData) { | ||
for(const langKey in languageData) { | ||
if (langKey === lang.value) { | ||
let currentLanguage = languageData[langKey]; | ||
for (let sentenceKey in currentLanguage) { | ||
const currentLanguage = languageData[langKey]; | ||
for (const sentenceKey in currentLanguage) { | ||
if (sentenceKey === key) { | ||
@@ -68,3 +70,3 @@ return currentLanguage[sentenceKey]; | ||
} | ||
let enString = key['en']?.key; | ||
const enString = key["en"]?.key; | ||
console.error("translation is not found: ", key); | ||
@@ -81,8 +83,8 @@ return enString; | ||
switch (reason) { | ||
case CHANGE_STATUS_REASON.REJECT: changeDialingInfo(`${t('be-rejected')}${callType.value === CALL_TYPE_STRING.AUDIO ? t('voice-call-end') : t('video-call-end')}`); break; | ||
case CHANGE_STATUS_REASON.NO_RESPONSE: changeDialingInfo(`${t('be-no-response')}${callType.value === CALL_TYPE_STRING.AUDIO ? t('voice-call-end') : t('video-call-end')}`); break; | ||
case CHANGE_STATUS_REASON.LINE_BUSY: changeDialingInfo(`${t('be-line-busy')}${callType.value === CALL_TYPE_STRING.AUDIO ? t('voice-call-end') : t('video-call-end')}`); break; | ||
case CHANGE_STATUS_REASON.CALLING_CANCEL: changeDialingInfo(t('be-canceled')); break; | ||
case CHANGE_STATUS_REASON.CALLING_TIMEOUT: changeDialingInfo(t('timeout')); break; | ||
default: changeDialingInfo(``); break; | ||
case CHANGE_STATUS_REASON.REJECT: changeDialingInfo(`${t("be-rejected")}${callType.value === CALL_TYPE_STRING.AUDIO ? t("voice-call-end") : t("video-call-end")}`); break; | ||
case CHANGE_STATUS_REASON.NO_RESPONSE: changeDialingInfo(`${t("be-no-response")}${callType.value === CALL_TYPE_STRING.AUDIO ? t("voice-call-end") : t("video-call-end")}`); break; | ||
case CHANGE_STATUS_REASON.LINE_BUSY: changeDialingInfo(`${t("be-line-busy")}${callType.value === CALL_TYPE_STRING.AUDIO ? t("voice-call-end") : t("video-call-end")}`); break; | ||
case CHANGE_STATUS_REASON.CALLING_CANCEL: changeDialingInfo(t("be-canceled")); break; | ||
case CHANGE_STATUS_REASON.CALLING_TIMEOUT: changeDialingInfo(t("timeout")); break; | ||
default: changeDialingInfo(""); break; | ||
} | ||
@@ -103,2 +105,3 @@ setTimeout(() => { | ||
isEntered: true, | ||
isReadyRender: false, | ||
}]); | ||
@@ -126,13 +129,8 @@ } | ||
function updateRemoteVolumeMap(volumeMap: any): void { | ||
volumeMap.forEach((item: any) => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function updateRemoteVolumeMap(newVolumeMap: any): void { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
newVolumeMap.forEach((item: any) => { | ||
const { userId, audioVolume } = item; | ||
if (userId === profile.value.userID) { | ||
profile.value.volume = audioVolume; | ||
return; | ||
} | ||
const isExisted = remoteList.value.findIndex((item: RemoteUser) => item.userID === userId); | ||
if (isExisted >= 0) { | ||
remoteList.value[isExisted].volume = audioVolume; | ||
} | ||
volumeMap.value.set(userId, audioVolume); | ||
}); | ||
@@ -166,3 +164,3 @@ } | ||
if (status.value === STATUS.BE_INVITED) { | ||
changeDialingInfo(callType.value === CALL_TYPE_STRING.AUDIO ? t('start-voice-call') : t('start-video-call')); | ||
changeDialingInfo(callType.value === CALL_TYPE_STRING.AUDIO ? t("start-voice-call") : t("start-video-call")); | ||
} | ||
@@ -187,2 +185,13 @@ } | ||
function getVolumeByUserID(userID: string): number { | ||
return volumeMap.value.get(userID) || 0; | ||
} | ||
export function makeRenderFlag(flag: string, userID: string) { | ||
const isExisted = remoteList.value.findIndex((item: RemoteUser) => item.userID === userID); | ||
if (isExisted >= 0) { | ||
remoteList.value[isExisted][flag] = true; | ||
} | ||
} | ||
export { | ||
@@ -205,2 +214,3 @@ status, | ||
updateRemoteVolumeMap, | ||
getVolumeByUserID, | ||
updateProfile, | ||
@@ -207,0 +217,0 @@ changeIsMinimized, |
@@ -9,3 +9,3 @@ import * as Aegis from "aegis-web-sdk"; | ||
reportAssetSpeed: true, // 静态资源测速 | ||
version: "1.3.2", | ||
version: "1.3.3", | ||
}); | ||
@@ -15,62 +15,62 @@ | ||
aegis.reportEvent({ | ||
name: 'login', | ||
ext1: 'login-success', | ||
ext2: 'webTUICallKit', | ||
name: "login", | ||
ext1: "login-success", | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const loginFailed = (SDKAppID: number, errorMessage: string) => { | ||
aegis.reportEvent({ | ||
name: 'login', | ||
name: "login", | ||
ext1: `login-failed-${errorMessage}`, | ||
ext2: 'webTUICallKit', | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const loginWithTUICoreSuccess = (SDKAppID: number) => { | ||
aegis.reportEvent({ | ||
name: 'loginWithTUICore', | ||
ext1: 'loginWithTUICore-success', | ||
ext2: 'webTUICallKit', | ||
name: "loginWithTUICore", | ||
ext1: "loginWithTUICore-success", | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const loginWithTUICoreFailed = (SDKAppID: number, errorMessage: string) => { | ||
aegis.reportEvent({ | ||
name: 'loginWithTUICore', | ||
name: "loginWithTUICore", | ||
ext1: `loginWithTUICore-failed-${errorMessage}`, | ||
ext2: 'webTUICallKit', | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const loginWithTIMSuccess = (SDKAppID: number) => { | ||
aegis.reportEvent({ | ||
name: 'loginWithTIM', | ||
ext1: 'loginWithTIM-success', | ||
ext2: 'webTUICallKit', | ||
name: "loginWithTIM", | ||
ext1: "loginWithTIM-success", | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const loginWithTIMFailed = (SDKAppID: number, errorMessage: string) => { | ||
aegis.reportEvent({ | ||
name: 'loginWithTIM', | ||
name: "loginWithTIM", | ||
ext1: `loginWithTIM-failed-${errorMessage}`, | ||
ext2: 'webTUICallKit', | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const switchCallType = (SDKAppID: number) => { | ||
aegis.reportEvent({ | ||
name: 'switchCallType', | ||
ext1: 'switchCallType-success', | ||
ext2: 'webTUICallKit', | ||
name: "switchCallType", | ||
ext1: "switchCallType-success", | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
@@ -81,6 +81,6 @@ const callSuccess = (SDKAppID: number, callType: string, typeString: string) => { | ||
ext1: `${callType}-${typeString}-success`, | ||
ext2: 'webTUICallKit', | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
@@ -91,15 +91,15 @@ const callFailed = (SDKAppID: number, callType: string, typeString: string, errorMessage: string) => { | ||
ext1: `${callType}-${typeString}-failed-${errorMessage}`, | ||
ext2: 'webTUICallKit', | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
const MinimizeSuccess = (SDKAppID: number) => { | ||
aegis.reportEvent({ | ||
name: 'Minimized', | ||
ext1: `Minimized-success`, | ||
ext2: 'webTUICallKit', | ||
name: "Minimized", | ||
ext1: "Minimized-success", | ||
ext2: "webTUICallKit", | ||
ext3: SDKAppID.toString() | ||
}); | ||
} | ||
}; | ||
@@ -106,0 +106,0 @@ const logReporter = { |
/** | ||
* 当前浏览器是否为移动端浏览器 | ||
*/ | ||
export const isMobile: boolean = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); | ||
export const isMobile: boolean = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); |
@@ -1,4 +0,5 @@ | ||
import { ref } from 'vue'; | ||
import { ref } from "vue"; | ||
let timer = 0; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
let timerIncrease: any; | ||
@@ -5,0 +6,0 @@ const timerString = ref<string>(""); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2307
275433
45
79
Updatedaegis-web-sdk@^1.36.5
Updatedtim-js-sdk@^2.25.0
Updatedtrtc-js-sdk@^4.15.1
Updatedtsignaling@^1.0.3
Updatedtuicall-engine-webrtc@^1.3.1