280 lines
16 KiB
JavaScript
280 lines
16 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("./common/vendor.js");
|
|
const TUICallKit_src_TUICallService_index = require("./TUICallKit/src/TUICallService/index.js");
|
|
const TUICallKit_src_Components_context_CallInfoContext = require("./TUICallKit/src/Components/context/CallInfoContext.js");
|
|
const TUICallKit_src_Components_context_CallerUserInfoContext = require("./TUICallKit/src/Components/context/CallerUserInfoContext.js");
|
|
const TUICallKit_src_Components_context_UserInfoContextExcludeVolume = require("./TUICallKit/src/Components/context/UserInfoContextExcludeVolume.js");
|
|
const TUICallKit_src_Components_context_FloatWindowContext = require("./TUICallKit/src/Components/context/FloatWindowContext.js");
|
|
const TUICallKit_src_Components_context_CustomUIConfigContext = require("./TUICallKit/src/Components/context/CustomUIConfigContext.js");
|
|
const TUICallKit_src_Components_context_TranslateContext = require("./TUICallKit/src/Components/context/TranslateContext.js");
|
|
const TUICallKit_src_Components_util_isEmpty = require("./TUICallKit/src/Components/util/isEmpty.js");
|
|
const TUICallKit_src_TUICallService_CallService_index = require("./TUICallKit/src/TUICallService/CallService/index.js");
|
|
const TUICallKit_src_TUICallService_const_index = require("./TUICallKit/src/TUICallService/const/index.js");
|
|
const TUICallKit_src_TUICallService_const_call = require("./TUICallKit/src/TUICallService/const/call.js");
|
|
if (!Math) {
|
|
"./pages/index/index.js";
|
|
"./pages/user/user.js";
|
|
"./TUICallKit/pages/call.js";
|
|
}
|
|
if (!Array) {
|
|
const _component_AISubtitle = common_vendor.resolveComponent("AISubtitle");
|
|
_component_AISubtitle();
|
|
}
|
|
if (!Math) {
|
|
(SingleCall + GroupCall)();
|
|
}
|
|
const SingleCall = () => "./TUICallKit/src/Components/components/SingleCall/SingleCall.js";
|
|
const GroupCall = () => "./TUICallKit/src/Components/components/GroupCall/GroupCall.js";
|
|
const _sfc_main$1 = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "TUICallKit",
|
|
props: {
|
|
beforeCalling: {},
|
|
afterCalling: {},
|
|
onMinimized: {},
|
|
onMessageSentByMe: {},
|
|
kickedOut: {},
|
|
statusChanged: {},
|
|
allowedMinimized: { type: Boolean, default: false },
|
|
allowedFullScreen: { type: Boolean, default: true },
|
|
videoDisplayMode: { default: TUICallKit_src_TUICallService_const_call.VideoDisplayMode.COVER },
|
|
videoResolution: { default: TUICallKit_src_TUICallService_const_call.VideoResolution.RESOLUTION_720P }
|
|
},
|
|
setup(__props) {
|
|
const isMobile = !TUICallKit_src_TUICallService_CallService_index.TUIGlobal.isPC;
|
|
const bodyStyle = isMobile ? "TUICallKit-mobile transition-animation" : "TUICallKit-desktop";
|
|
const miniMizedDeskStyle = common_vendor.ref("");
|
|
const mobileAudioStyle = common_vendor.ref("");
|
|
const mobileVideoStyle = common_vendor.ref("");
|
|
const isShowFloatWindow = common_vendor.ref(false);
|
|
const props = __props;
|
|
const callStatus = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.CALL_STATUS));
|
|
const callRole = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.CALL_ROLE));
|
|
const callType = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.CALL_MEDIA_TYPE));
|
|
const isGroupCall = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.IS_GROUP));
|
|
const isEarPhone = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.IS_EAR_PHONE));
|
|
const focusElement = common_vendor.ref(null);
|
|
const localUserInfoExcludeVolume = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.LOCAL_USER_INFO_EXCLUDE_VOLUMN));
|
|
const remoteUserListExcludeVolume = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST));
|
|
const callerUserInfo = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.CALLER_USER_INFO));
|
|
const isFloatWindow = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.IS_MINIMIZED));
|
|
const enableVirtualBackground = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.ENABLE_VIRTUAL_BACKGROUND));
|
|
const isShowEnableVirtualBackground = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND));
|
|
const customUIConfigContextValue = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.CUSTOM_UI_CONFIG));
|
|
const isMuteSpeaker = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.IS_MUTE_SPEAKER));
|
|
const translate = common_vendor.ref(TUICallKit_src_TUICallService_CallService_index.TUIStore.getData(TUICallKit_src_TUICallService_const_call.StoreName.CALL, TUICallKit_src_TUICallService_const_index.NAME.TRANSLATE));
|
|
const callInfoContextValue = common_vendor.reactive({
|
|
callStatus,
|
|
callRole,
|
|
callType,
|
|
isGroupCall,
|
|
isEarPhone,
|
|
focusElement,
|
|
allowedFullScreen: props.allowedFullScreen,
|
|
enableVirtualBackground,
|
|
isShowEnableVirtualBackground,
|
|
isMuteSpeaker
|
|
});
|
|
const callerUserInfoValue = common_vendor.reactive({ callerUserInfo });
|
|
const userInfoExcludeVolumeContextValue = common_vendor.reactive({
|
|
localUserInfoExcludeVolume,
|
|
remoteUserListExcludeVolume
|
|
});
|
|
const floatWindowContextValue = common_vendor.reactive({ isFloatWindow });
|
|
const translateContextValue = common_vendor.ref(translate);
|
|
const {
|
|
beforeCalling,
|
|
afterCalling,
|
|
onMinimized,
|
|
onMessageSentByMe,
|
|
videoDisplayMode,
|
|
videoResolution,
|
|
kickedOut,
|
|
statusChanged,
|
|
allowedMinimized
|
|
} = common_vendor.toRefs(props);
|
|
const handleCallStatusChange = (value) => {
|
|
callInfoContextValue.callStatus = value;
|
|
};
|
|
const handleIsGroupChange = (value) => {
|
|
callInfoContextValue.isGroupCall = value;
|
|
};
|
|
const handleToastInfoChange = (value) => {
|
|
if (typeof value === "object") {
|
|
const { content, type = "info" } = value;
|
|
!TUICallKit_src_Components_util_isEmpty.isEmpty(content) && showToast(translate.value(content), type);
|
|
}
|
|
};
|
|
const handleCallMediaTypeChange = (value) => {
|
|
callInfoContextValue.callType = value;
|
|
if (isMobile && isShowFloatWindow.value) {
|
|
mobileVideoStyle.value = "miniMized-mobile-audio";
|
|
mobileAudioStyle.value = "";
|
|
}
|
|
if (isMobile && !isShowFloatWindow.value) {
|
|
mobileAudioStyle.value = "mobile-audio";
|
|
}
|
|
};
|
|
const handleIsMinimizedChange = (value) => {
|
|
floatWindowContextValue.isFloatWindow = value;
|
|
if (value) {
|
|
if (!isMobile) {
|
|
miniMizedDeskStyle.value = "miniMized";
|
|
} else {
|
|
if (callInfoContextValue.callType === TUICallKit_src_TUICallService_const_call.CallMediaType.AUDIO) {
|
|
mobileAudioStyle.value = "miniMized-mobile-audio";
|
|
} else {
|
|
mobileVideoStyle.value = "miniMized-mobile-video";
|
|
}
|
|
}
|
|
} else {
|
|
mobileAudioStyle.value = "mobile-audio";
|
|
miniMizedDeskStyle.value = "";
|
|
mobileVideoStyle.value = "";
|
|
}
|
|
};
|
|
const handlePermissionErrorTipChange = (data) => {
|
|
};
|
|
const handleCallRoleChange = (value) => {
|
|
callInfoContextValue.callRole = value;
|
|
};
|
|
const handleLocalUserInfoChange = (value) => {
|
|
userInfoExcludeVolumeContextValue.localUserInfoExcludeVolume = value;
|
|
};
|
|
const handleRemoteUserInfoListChange = (value) => {
|
|
userInfoExcludeVolumeContextValue.remoteUserListExcludeVolume = [...value];
|
|
};
|
|
const handleCallerUserInfoChange = (value) => {
|
|
callerUserInfoValue.callerUserInfo = value;
|
|
};
|
|
const handEarPhoneChange = (value) => {
|
|
callInfoContextValue.isEarPhone = value;
|
|
};
|
|
const handleEnableVirtualBackgroundChange = (value) => {
|
|
callInfoContextValue.enableVirtualBackground = value;
|
|
};
|
|
const handleIsShowEnableVirtualBackgroundChange = (value) => {
|
|
callInfoContextValue.isShowEnableVirtualBackground = value;
|
|
};
|
|
const handleCustomUIConfigChange = (value) => {
|
|
customUIConfigContextValue.value = value;
|
|
};
|
|
const handleMuteSpeakerChange = (value) => {
|
|
callInfoContextValue.isMuteSpeaker = value;
|
|
};
|
|
const handleTranslateChange = (value) => {
|
|
translate.value = value;
|
|
};
|
|
common_vendor.watchEffect(() => {
|
|
TUICallKit_src_TUICallService_index.TUICallKitAPI.setCallback({
|
|
beforeCalling: beforeCalling && beforeCalling.value,
|
|
afterCalling: afterCalling && afterCalling.value,
|
|
onMinimized: onMinimized && onMinimized.value,
|
|
onMessageSentByMe: onMessageSentByMe && onMessageSentByMe.value,
|
|
kickedOut: kickedOut && kickedOut.value,
|
|
statusChanged: statusChanged && statusChanged.value
|
|
});
|
|
});
|
|
const watchOptions = {
|
|
[TUICallKit_src_TUICallService_const_index.NAME.CALL_STATUS]: handleCallStatusChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.IS_GROUP]: handleIsGroupChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.TOAST_INFO]: handleToastInfoChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.CALL_MEDIA_TYPE]: handleCallMediaTypeChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.SHOW_PERMISSION_TIP]: handlePermissionErrorTipChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.CALL_ROLE]: handleCallRoleChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.LOCAL_USER_INFO_EXCLUDE_VOLUMN]: handleLocalUserInfoChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]: handleRemoteUserInfoListChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.CALLER_USER_INFO]: handleCallerUserInfoChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.IS_EAR_PHONE]: handEarPhoneChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.ENABLE_VIRTUAL_BACKGROUND]: handleEnableVirtualBackgroundChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND]: handleIsShowEnableVirtualBackgroundChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.CUSTOM_UI_CONFIG]: handleCustomUIConfigChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.IS_MUTE_SPEAKER]: handleMuteSpeakerChange,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.TRANSLATE]: handleTranslateChange
|
|
};
|
|
common_vendor.onMounted(() => {
|
|
if (allowedMinimized.value) {
|
|
TUICallKit_src_TUICallService_index.TUICallKitAPI.enableFloatWindow(allowedMinimized.value);
|
|
}
|
|
TUICallKit_src_TUICallService_index.TUICallKitAPI.setVideoDisplayMode(videoDisplayMode.value);
|
|
TUICallKit_src_TUICallService_index.TUICallKitAPI.setVideoResolution(videoResolution.value);
|
|
TUICallKit_src_TUICallService_CallService_index.TUIStore.watch(
|
|
TUICallKit_src_TUICallService_const_call.StoreName.CALL,
|
|
watchOptions,
|
|
{
|
|
notifyRangeWhenWatch: TUICallKit_src_TUICallService_const_index.NAME.MYSELF
|
|
}
|
|
);
|
|
TUICallKit_src_TUICallService_CallService_index.TUIStore.watch(TUICallKit_src_TUICallService_const_call.StoreName.CALL, {
|
|
[TUICallKit_src_TUICallService_const_index.NAME.IS_MINIMIZED]: handleIsMinimizedChange
|
|
});
|
|
});
|
|
function showToast(value, type) {
|
|
switch (type) {
|
|
case "info":
|
|
common_vendor.index.showToast({
|
|
title: value,
|
|
icon: "none"
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
common_vendor.onUnmounted(async () => {
|
|
TUICallKit_src_TUICallService_CallService_index.TUIStore.unwatch(TUICallKit_src_TUICallService_const_call.StoreName.CALL, {
|
|
...watchOptions,
|
|
[TUICallKit_src_TUICallService_const_index.NAME.IS_MINIMIZED]: handleIsMinimizedChange
|
|
});
|
|
await TUICallKit_src_TUICallService_index.TUICallKitAPI.handleExceptionExit();
|
|
});
|
|
common_vendor.provide(TUICallKit_src_Components_context_CallInfoContext.CallInfoContextKey, callInfoContextValue);
|
|
common_vendor.provide(TUICallKit_src_Components_context_CallerUserInfoContext.CallerUserInfoContextKey, callerUserInfoValue);
|
|
common_vendor.provide(TUICallKit_src_Components_context_UserInfoContextExcludeVolume.UserInfoExcludeVolumeContextKey, userInfoExcludeVolumeContextValue);
|
|
common_vendor.provide(TUICallKit_src_Components_context_FloatWindowContext.FloatWindowContextKey, floatWindowContextValue);
|
|
common_vendor.provide(TUICallKit_src_Components_context_CustomUIConfigContext.CustomUIConfigContextKey, customUIConfigContextValue);
|
|
common_vendor.provide(TUICallKit_src_Components_context_TranslateContext.translateContextKey, translateContextValue);
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.unref(callInfoContextValue).callStatus !== common_vendor.unref(TUICallKit_src_TUICallService_const_call.CallStatus).IDLE
|
|
}, common_vendor.unref(callInfoContextValue).callStatus !== common_vendor.unref(TUICallKit_src_TUICallService_const_call.CallStatus).IDLE ? common_vendor.e({
|
|
b: !common_vendor.unref(callInfoContextValue).isGroupCall
|
|
}, !common_vendor.unref(callInfoContextValue).isGroupCall ? {} : {}, {
|
|
c: common_vendor.s({
|
|
visibility: common_vendor.unref(floatWindowContextValue).isFloatWindow ? "hidden" : ""
|
|
}),
|
|
d: common_vendor.n(common_vendor.unref(bodyStyle)),
|
|
e: common_vendor.n(common_vendor.unref(miniMizedDeskStyle)),
|
|
f: common_vendor.n(common_vendor.unref(mobileVideoStyle)),
|
|
g: common_vendor.n(common_vendor.unref(mobileAudioStyle))
|
|
}) : {});
|
|
};
|
|
}
|
|
});
|
|
const _sfc_main = {
|
|
onLaunch: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:10", "App Launch");
|
|
},
|
|
onShow: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:13", "App Show");
|
|
},
|
|
onHide: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:16", "App Hide");
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _component_TUICallKit = common_vendor.resolveComponent("TUICallKit");
|
|
_component_TUICallKit();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {};
|
|
}
|
|
const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
function createApp() {
|
|
const app = common_vendor.createSSRApp(App);
|
|
return {
|
|
app
|
|
};
|
|
}
|
|
createApp().app.mount("#app");
|
|
exports._sfc_main = _sfc_main$1;
|
|
exports.createApp = createApp;
|
|
//# sourceMappingURL=../.sourcemap/mp-weixin/main.js.map
|