@tencentcloud/call-uikit-wechat
Advanced tools
Comparing version 2.1.2 to 2.1.3
import { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, StatusChange as STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, t } from './TUICallService/index'; | ||
declare const Version = "2.1.2"; | ||
declare const Version = "2.1.3"; | ||
export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, Version, t, }; |
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_1.t; } }); | ||
const Version = '2.1.2'; // basic-demo 原来上报使用 | ||
const Version = '2.1.3'; // basic-demo 原来上报使用 | ||
exports.Version = Version; |
{ | ||
"name": "@tencentcloud/call-uikit-wechat", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"main": "./tuicall-uikit-vue.umd.js", | ||
@@ -5,0 +5,0 @@ "module": "./tuicall-uikit-vue.es.js", |
@@ -1,3 +0,3 @@ | ||
import { TUICallKitServer } from "../../../TUICallService/index"; | ||
const PATH = '../../../static'; | ||
import { TUICallKitServer, CallMediaType } from "../../../TUICallService/index"; | ||
const PATH = "../../../static"; | ||
Component({ | ||
@@ -24,3 +24,3 @@ properties: { | ||
localUserInfo: { | ||
type:Object | ||
type: Object, | ||
}, | ||
@@ -34,17 +34,24 @@ remoteUserInfoList: { | ||
bigScreenUserId: { | ||
type: Boolean | ||
} | ||
type: Boolean, | ||
}, | ||
enableFloatWindow: { | ||
type: Boolean, | ||
}, | ||
}, | ||
data:{ | ||
IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, | ||
IMG_HANGUP:`${PATH}/hangup.png`, | ||
data: { | ||
IMG_DEFAULT_AVATAR: `${PATH}/default_avatar.png`, | ||
IMG_HANGUP: `${PATH}/hangup.png`, | ||
IMG_ACCEPT: `${PATH}/dialing.png`, | ||
IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, | ||
IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, | ||
IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, | ||
IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, | ||
IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, | ||
IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, | ||
IMG_TRANS:`${PATH}/trans.png`, | ||
IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, | ||
IMG_SPEAKER_FALSE: `${PATH}/speaker-false.png`, | ||
IMG_SPEAKER_TRUE: `${PATH}/speaker-true.png`, | ||
IMG_AUDIO_TRUE: `${PATH}/audio-true.png`, | ||
IMG_AUDIO_FALSE: `${PATH}/audio-false.png`, | ||
IMG_CAMERA_TRUE: `${PATH}/camera-true.png`, | ||
IMG_CAMERA_FALSE: `${PATH}/camera-false.png`, | ||
IMG_TRANS: `${PATH}/trans.png`, | ||
IMG_SWITCH_CAMERA: `${PATH}/switch_camera.png`, | ||
IMG_MINIMIZE_BLACK: `${PATH}/minimize-black.svg`, | ||
IMG_MINIMIZE_WHITE: `${PATH}/minimize-white.png`, | ||
// 使用空字符串作为属性传入,属性更新不会更新live-pusher | ||
pictureMode: "push", | ||
}, | ||
@@ -56,2 +63,3 @@ methods: { | ||
async hangup() { | ||
this.exitPictureInPicture(); | ||
await TUICallKitServer.hangup(); | ||
@@ -65,2 +73,5 @@ }, | ||
}, | ||
toggleMinimize() { | ||
wx.navigateBack(); | ||
}, | ||
async switchCallMediaType() { | ||
@@ -87,5 +98,10 @@ await TUICallKitServer.switchCallMediaType(); | ||
toggleViewSize() { | ||
TUICallKitServer.switchScreen(this.data.bigScreenUserId ? 'player':'localVideo') | ||
TUICallKitServer.switchScreen( | ||
this.data.bigScreenUserId ? "player" : "localVideo" | ||
); | ||
}, | ||
pusherStateChangeHandler(e) { | ||
if (this.data.enableFloatWindow) { | ||
this.handlePusherCode(e); | ||
} | ||
TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); | ||
@@ -103,2 +119,5 @@ }, | ||
playerStateChange(e) { | ||
if (this.data.enableFloatWindow) { | ||
this.handlePlayerCode(e); | ||
} | ||
TUICallKitServer._tuiCallEngine._playerStateChange(e); | ||
@@ -112,3 +131,40 @@ }, | ||
}, | ||
handlePusherCode(e) { | ||
// 1032:远端主播退房通知,需要早于 TRTC-WX 抛出的远端用户离开事件 | ||
if (e.detail.code === 1032) { | ||
this.setData({ | ||
pictureMode: "push", | ||
}); | ||
} | ||
}, | ||
handlePlayerCode(e) { | ||
// 音频通话只会抛出 2002 状态码,2002 拉流:已经连接 RTMP 服务器,开始拉流 | ||
if (this.data.callMediaType === CallMediaType.AUDIO && e.detail.code === 2002) { | ||
this.setData({ | ||
pictureMode: "pop", | ||
}); | ||
} | ||
// 主要兼容 web 端初始化流较慢,在没有拉到远端流时,开启画中画偶现退房的问题 | ||
// 2004 拉流:视频播放开始,这个状态抛出表示远端视频流开始播放 | ||
if (this.data.callMediaType === CallMediaType.VIDEO && e.detail.code === 2004) { | ||
this.setData({ | ||
pictureMode: "pop", | ||
}); | ||
} | ||
}, | ||
exitPictureInPicture() { | ||
if (!this.data.enableFloatWindow) return; | ||
// ios 设备需要通过属性来控制小窗的关闭 | ||
this.setData({ | ||
pictureMode: "push", | ||
}); | ||
// Android 设备需要通过 exitPictureInPicture 接口关闭悬浮窗 | ||
TUICallKitServer.getTUICallEngineInstance().TRTC.pusherInstance.context.exitPictureInPicture(); | ||
}, | ||
}, | ||
lifetimes: { | ||
detached() { | ||
this.exitPictureInPicture(); | ||
}, | ||
}, | ||
}); |
@@ -1,2 +0,2 @@ | ||
import { TUIStore, StoreName, NAME } from "../index"; | ||
import { TUICallKitServer, TUIStore, StoreName, NAME } from "../index"; | ||
@@ -19,2 +19,3 @@ const { | ||
TOAST_INFO, | ||
ENABLE_FLOAT_WINDOW, | ||
} = NAME; | ||
@@ -33,3 +34,3 @@ | ||
localUserInfo: TUIStore.getData(StoreName.CALL, LOCAL_USER_INFO), // 本地用户信息 | ||
callerUserInfo: TUIStore.getData(StoreName.CALL, CALLER_USER_INFO),// 邀请者用户信息 | ||
callerUserInfo: TUIStore.getData(StoreName.CALL, CALLER_USER_INFO), // 邀请者用户信息 | ||
remoteUserInfoList: TUIStore.getData(StoreName.CALL, REMOTE_USER_INFO_LIST), // 远端用户信息 | ||
@@ -39,2 +40,3 @@ pusher: TUIStore.getData(StoreName.CALL, PUSHER), // TRTC 本地流 | ||
playerProcess: {}, // 经过处理的的远端流(多人通话) | ||
enableFloatWindow: TUIStore.getData(StoreName.CALL, ENABLE_FLOAT_WINDOW), // 开启/关闭悬浮窗功能,设置为false,通话界面左上角的悬浮窗按钮会隐藏 | ||
}, | ||
@@ -152,2 +154,7 @@ methods: { | ||
}, | ||
handleFloatWindowChange(value) { | ||
this.setData({ | ||
enableFloatWindow: value, | ||
}); | ||
}, | ||
}, | ||
@@ -175,2 +182,3 @@ | ||
[PLAYER]: this.handlePlayerListChange.bind(that), | ||
[ENABLE_FLOAT_WINDOW]: this.handleFloatWindowChange.bind(that), | ||
}, | ||
@@ -198,5 +206,7 @@ { | ||
[PLAYER]: this.handlePlayerListChange.bind(that), | ||
[ENABLE_FLOAT_WINDOW]: this.handleFloatWindowChange.bind(that), | ||
}); | ||
await TUICallKitServer.handleExceptionExit(); | ||
}, | ||
}, | ||
}); |
@@ -74,5 +74,5 @@ import { ITUICallService, ICallParams, IGroupCallParams, ICallbackParam, ISelfInfoParams, IInviteUserParams, IJoinInGroupCallParams, IInitParams } from '../interface/ICallService'; | ||
private _executeExternalAfterCalling; | ||
handleExceptionExit(): Promise<void>; | ||
setVideoDisplayMode(displayMode: VideoDisplayMode): void; | ||
setVideoResolution(resolution: VideoResolution): Promise<void>; | ||
private _handleExceptionExit; | ||
private _setLocalUserInfoAudioVideoAvailable; | ||
@@ -79,0 +79,0 @@ private _updateCallStoreBeforeCall; |
@@ -17,3 +17,3 @@ "use strict"; | ||
// @ts-ignore | ||
wx.hideKeyboard({ | ||
wx.hideKeyboard && wx.hideKeyboard({ | ||
complete: () => { }, | ||
@@ -20,0 +20,0 @@ }); |
@@ -13,1 +13,5 @@ export * from './call'; | ||
} | ||
export declare enum COMPONENT { | ||
TUI_CALL_KIT = 14, | ||
TIM_CALL_KIT = 15 | ||
} |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PLATFORM = exports.MAX_NUMBER_ROOM_ID = exports.VideoCallIcon = exports.AudioCallIcon = exports.NAME = exports.CALL_DATA_KEY = void 0; | ||
exports.COMPONENT = exports.PLATFORM = exports.MAX_NUMBER_ROOM_ID = exports.VideoCallIcon = exports.AudioCallIcon = exports.NAME = exports.CALL_DATA_KEY = void 0; | ||
__exportStar(require("./call"), exports); | ||
@@ -52,2 +52,4 @@ __exportStar(require("./error"), exports); | ||
SHOW_SELECT_USER: 'showSelectUser', | ||
IS_SHOW_ENABLE_VIRTUAL_BACKGROUND: 'isShowEnableVirtualBackground', | ||
ENABLE_VIRTUAL_BACKGROUND: 'enableVirtualBackground', | ||
}; | ||
@@ -65,1 +67,10 @@ exports.NAME = Object.assign({ PREFIX: '【CallService】', AUDIO: 'audio', VIDEO: 'video', LOCAL_VIDEO: 'localVideo', ERROR: 'error', TIMEOUT: 'timeout', RAF: 'raf', INTERVAL: 'interval', DEFAULT: 'default', BOOLEAN: 'boolean', STRING: 'string', NUMBER: 'number', OBJECT: 'object', ARRAY: 'array', FUNCTION: 'function', UNDEFINED: "undefined", ALL: 'all', MYSELF: 'myself', DEVICE_LIST: 'deviceList', CAMERA_POSITION: 'cameraPosition' }, exports.CALL_DATA_KEY); | ||
})(PLATFORM = exports.PLATFORM || (exports.PLATFORM = {})); | ||
; | ||
var COMPONENT; | ||
(function (COMPONENT) { | ||
// eslint-disable-next-line no-unused-vars | ||
COMPONENT[COMPONENT["TUI_CALL_KIT"] = 14] = "TUI_CALL_KIT"; | ||
// eslint-disable-next-line no-unused-vars | ||
COMPONENT[COMPONENT["TIM_CALL_KIT"] = 15] = "TIM_CALL_KIT"; | ||
})(COMPONENT = exports.COMPONENT || (exports.COMPONENT = {})); | ||
; |
@@ -29,2 +29,3 @@ import { CallStatus, CallRole } from '../const/index'; | ||
isFromChat?: boolean; | ||
component?: number; | ||
} | ||
@@ -31,0 +32,0 @@ export type IInitParams = IInitParamsBase & SDKAppID; |
@@ -36,2 +36,4 @@ import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList, CameraPosition } from '../const/index'; | ||
showSelectUser: boolean; | ||
isShowEnableVirtualBackground: boolean; | ||
enableVirtualBackground: boolean; | ||
} |
@@ -13,2 +13,3 @@ export declare const en: { | ||
'video-to-audio': string; | ||
'virtual-background': string; | ||
'other side reject call': string; | ||
@@ -53,2 +54,3 @@ 'reject call': string; | ||
'you have a new call': string; | ||
'switch camera': string; | ||
'Those involved': string; | ||
@@ -55,0 +57,0 @@ call: string; |
@@ -17,2 +17,3 @@ "use strict"; | ||
'video-to-audio': 'Switch to audio', | ||
'virtual-background': 'Blur Background', | ||
// 通话结果 | ||
@@ -61,2 +62,3 @@ 'other side reject call': 'other side reject call', | ||
'you have a new call': 'You have a new call', | ||
'switch camera': 'Switch', | ||
// 待废弃文案 | ||
@@ -63,0 +65,0 @@ 'Those involved': 'Those involved in the call are', |
@@ -8,2 +8,3 @@ export declare const ja_JP: { | ||
speaker: string; | ||
'virtual-background': string; | ||
'other side reject call': string; | ||
@@ -47,2 +48,3 @@ 'reject call': string; | ||
'you have a new call': string; | ||
'switch camera': string; | ||
timeout: string; | ||
@@ -49,0 +51,0 @@ 'kick out': string; |
@@ -12,2 +12,3 @@ "use strict"; | ||
'speaker': 'スピーカー', | ||
'virtual-background': 'ボケ背景', | ||
// 通话结果 | ||
@@ -55,2 +56,3 @@ 'other side reject call': '通話が拒否されました', | ||
'you have a new call': '新しい通話があります', | ||
'switch camera': '切り替え', | ||
// 待废弃文案 | ||
@@ -57,0 +59,0 @@ 'timeout': 'タイムアウト', |
@@ -13,2 +13,3 @@ export declare const zh: { | ||
'video-to-audio': string; | ||
'virtual-background': string; | ||
'other side reject call': string; | ||
@@ -53,2 +54,3 @@ 'reject call': string; | ||
'you have a new call': string; | ||
'switch camera': string; | ||
timeout: string; | ||
@@ -55,0 +57,0 @@ 'kick out': string; |
@@ -17,2 +17,3 @@ "use strict"; | ||
'video-to-audio': '转语音通话', | ||
'virtual-background': '模糊背景', | ||
// 通话结果 | ||
@@ -61,2 +62,3 @@ 'other side reject call': '对方已拒绝', | ||
'you have a new call': '您有一个新的通话', | ||
'switch camera': '翻转', | ||
// 待废弃文案 | ||
@@ -63,0 +65,0 @@ 'timeout': '超时', |
export declare class CallManager { | ||
private _globalCallPagePath; | ||
private _isPageRedirected; | ||
init(params: any): Promise<void>; | ||
@@ -10,3 +9,4 @@ private _watchTUIStore; | ||
private _handleCallStatusToIdle; | ||
getRoute(): any; | ||
destroyed(): Promise<void>; | ||
} |
@@ -25,2 +25,3 @@ "use strict"; | ||
const index_3 = require("../utils/validate/index"); | ||
const env_1 = require("../utils/env"); | ||
/** | ||
@@ -37,3 +38,2 @@ * @param {Number} sdkAppID 用户的sdkAppID 必传 | ||
this._globalCallPagePath = ''; | ||
this._isPageRedirected = false; | ||
this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { | ||
@@ -68,4 +68,7 @@ switch (value) { | ||
this._watchTUIStore(); | ||
// 全局监听下,关闭悬浮窗 | ||
index_1.TUICallKitServer.enableFloatWindow(false); | ||
// uniApp 小程序全局监听下,关闭悬浮窗 | ||
if (!env_1.IN_WX_MINI_APP) { | ||
index_1.TUICallKitServer.enableFloatWindow(false); | ||
} | ||
; | ||
console.log(`${PREFIX} init Ready!`); | ||
@@ -92,3 +95,3 @@ } | ||
_handleCallStatusToCalling() { | ||
if (this._isPageRedirected) | ||
if (this.getRoute() === this._globalCallPagePath) | ||
return; | ||
@@ -98,5 +101,3 @@ // @ts-ignore | ||
url: `/${this._globalCallPagePath}`, | ||
success: () => { | ||
this._isPageRedirected = true; | ||
}, | ||
success: () => { }, | ||
fail: () => { | ||
@@ -109,9 +110,7 @@ console.error(`${PREFIX} navigateTo fail!`); | ||
_handleCallStatusToIdle() { | ||
if (!this._isPageRedirected) | ||
if (this.getRoute() !== this._globalCallPagePath) | ||
return; | ||
// @ts-ignore | ||
wx.navigateBack({ | ||
success: () => { | ||
this._isPageRedirected = false; | ||
}, | ||
success: () => { }, | ||
fail: () => { | ||
@@ -123,2 +122,9 @@ console.error(`${PREFIX} navigateBack fail!`); | ||
} | ||
// 获取当前的页面地址 | ||
getRoute() { | ||
// @ts-ignore | ||
const pages = getCurrentPages(); | ||
const currentPage = pages[pages.length - 1]; | ||
return currentPage.route; | ||
} | ||
// 卸载 callManger | ||
@@ -128,3 +134,2 @@ destroyed() { | ||
this._globalCallPagePath = ''; | ||
this._isPageRedirected = false; | ||
this._unwatchTUIStore(); | ||
@@ -131,0 +136,0 @@ yield index_1.TUICallKitServer.destroyed(); |
@@ -37,3 +37,6 @@ "use strict"; | ||
player: [], | ||
isEarPhone: false, // 是否是听筒, 默认: false | ||
isEarPhone: false, | ||
// 是否开启虚拟背景, 目前仅 web 支持 | ||
isShowEnableVirtualBackground: false, | ||
enableVirtualBackground: false, // 是否开启虚拟背景, 默认: false | ||
}; | ||
@@ -40,0 +43,0 @@ this.store = Object.assign({}, this.defaultStore); |
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 too big to display
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
467063
6052