call-live-sdk1 0.0.30 → 0.0.32
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.
- package/dist/call-live-sdk.es.js +23 -10
- package/dist/call-live-sdk.umd.js +1 -1
- package/dist/stats-prod.html +1 -1
- package/package.json +1 -1
package/dist/call-live-sdk.es.js
CHANGED
|
@@ -202796,8 +202796,8 @@ const useVideoSlotBinding = ({
|
|
|
202796
202796
|
return;
|
|
202797
202797
|
}
|
|
202798
202798
|
const [, streamIndex = "main"] = selectedValue.split(fenge);
|
|
202799
|
-
if (!targetUser || streamIndex === "screen" && !targetUser.isScreenEnabled) {
|
|
202800
|
-
console.log(`用户${item.userId}
|
|
202799
|
+
if (!targetUser || streamIndex === "screen" && !targetUser.isScreenEnabled || targetUser.waiting_mode_state === WaitingModeState.WAITING) {
|
|
202800
|
+
console.log(`用户${item.userId}已退出或被移至等候状态,恢复为空连麦嘉宾`);
|
|
202801
202801
|
setSelectedValue("");
|
|
202802
202802
|
try {
|
|
202803
202803
|
livePlayerRef.current.addEmptyVideoSlot({ id: item.id });
|
|
@@ -301593,7 +301593,7 @@ const useRoomMessageHandler = (params = {}) => {
|
|
|
301593
301593
|
case "leave":
|
|
301594
301594
|
return `${type4}`;
|
|
301595
301595
|
case "waiting_mode":
|
|
301596
|
-
return `${type4}_${(data2 == null ? void 0 : data2.rtc_userid) || userId}_${(data2 == null ? void 0 : data2.waiting_mode_state) || "unknown"}`;
|
|
301596
|
+
return `${type4}_${(data2 == null ? void 0 : data2.rtc_userid) || userId}_${(data2 == null ? void 0 : data2.waiting_mode_state) || "unknown"}_${Date.now()}`;
|
|
301597
301597
|
case "change_user":
|
|
301598
301598
|
return `${type4}_${userId}_${(data2 == null ? void 0 : data2.action) || "unknown"}`;
|
|
301599
301599
|
case "media":
|
|
@@ -301720,16 +301720,33 @@ const useRoomMessageHandler = (params = {}) => {
|
|
|
301720
301720
|
}
|
|
301721
301721
|
if (waiting_mode_state === WaitingModeState.ADMITTED) {
|
|
301722
301722
|
console.log("收到准入消息", waitingData);
|
|
301723
|
-
|
|
301723
|
+
let userFoundInArray = false;
|
|
301724
|
+
if (users && Array.isArray(users)) {
|
|
301724
301725
|
users.forEach((user) => {
|
|
301725
301726
|
if (user.rtc_userid === rtc_userid) {
|
|
301726
301727
|
user.waiting_mode_state = waiting_mode_state;
|
|
301728
|
+
userFoundInArray = true;
|
|
301729
|
+
console.log("在 users 数组中找到目标用户,更新状态", user);
|
|
301727
301730
|
}
|
|
301728
301731
|
if (user.rtc_userid) {
|
|
301729
301732
|
updateCallUser(user.rtc_userid, user);
|
|
301730
301733
|
}
|
|
301731
301734
|
});
|
|
301732
301735
|
}
|
|
301736
|
+
if (!userFoundInArray) {
|
|
301737
|
+
console.warn("users 数组中未找到目标用户,直接使用消息数据更新状态", {
|
|
301738
|
+
rtc_userid,
|
|
301739
|
+
waiting_mode_state,
|
|
301740
|
+
users
|
|
301741
|
+
});
|
|
301742
|
+
updateCallUser(rtc_userid, {
|
|
301743
|
+
waiting_mode_state: WaitingModeState.ADMITTED
|
|
301744
|
+
});
|
|
301745
|
+
console.log("已直接更新用户状态为 ADMITTED", {
|
|
301746
|
+
rtc_userid,
|
|
301747
|
+
waiting_mode_state: WaitingModeState.ADMITTED
|
|
301748
|
+
});
|
|
301749
|
+
}
|
|
301733
301750
|
}
|
|
301734
301751
|
} catch (error2) {
|
|
301735
301752
|
console.error("处理等候模式消息失败", {
|
|
@@ -304955,10 +304972,6 @@ const UserVideoContainer = reactExports.memo(({
|
|
|
304955
304972
|
const displayName = reactExports.useMemo(() => {
|
|
304956
304973
|
return user.nickname || "未知用户";
|
|
304957
304974
|
}, [user.nickname]);
|
|
304958
|
-
const isSelfWindow = reactExports.useMemo(() => {
|
|
304959
|
-
return videoId == null ? void 0 : videoId.includes("self");
|
|
304960
|
-
}, [videoId]);
|
|
304961
|
-
const maxNameLength = isSelfWindow ? 3 : 4;
|
|
304962
304975
|
const avatarChar = reactExports.useMemo(() => {
|
|
304963
304976
|
return displayName.trim().charAt(0);
|
|
304964
304977
|
}, [displayName]);
|
|
@@ -304982,7 +304995,7 @@ const UserVideoContainer = reactExports.memo(({
|
|
|
304982
304995
|
noMirror,
|
|
304983
304996
|
shouldMirror: +!noMirror
|
|
304984
304997
|
});
|
|
304985
|
-
const isModeFit = user.rtc_userid === callConfig.drawing_board_id || (videoId == null ? void 0 : videoId.includes("screen")) || user.device === "pc";
|
|
304998
|
+
const isModeFit = user.rtc_userid === callConfig.drawing_board_id || (videoId == null ? void 0 : videoId.includes("screen")) || user.device === "pc" || videoId.includes("self");
|
|
304986
304999
|
window.log.push({
|
|
304987
305000
|
com: "UserVideoContainer",
|
|
304988
305001
|
params: {
|
|
@@ -305072,7 +305085,7 @@ const UserVideoContainer = reactExports.memo(({
|
|
|
305072
305085
|
className: "",
|
|
305073
305086
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
305074
305087
|
className: "bg-black bg-opacity-50 rounded px-2 py-1 text-white text-xs font-medium truncate",
|
|
305075
|
-
children: displayName ? displayName.length >
|
|
305088
|
+
children: displayName ? displayName.length > 4 ? `${displayName.substring(0, 3)}...` : displayName : ""
|
|
305076
305089
|
})
|
|
305077
305090
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
305078
305091
|
className: `
|