call-live-sdk1 0.0.6 → 0.0.7
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 +57 -134
- package/dist/call-live-sdk.umd.js +1 -1
- package/dist/stats-prod.html +1 -1
- package/dist/stores/callStore.d.ts +4 -1
- package/package.json +1 -1
package/dist/call-live-sdk.es.js
CHANGED
|
@@ -25627,8 +25627,8 @@ const envConfig = {
|
|
|
25627
25627
|
},
|
|
25628
25628
|
guestConfig: {
|
|
25629
25629
|
el: "",
|
|
25630
|
-
liveId: envConfig$1.env === "development" ?
|
|
25631
|
-
agentId: envConfig$1.env === "development" ?
|
|
25630
|
+
liveId: envConfig$1.env === "development" ? 60974 : null,
|
|
25631
|
+
agentId: envConfig$1.env === "development" ? 38735989 : null,
|
|
25632
25632
|
apiDomain: envConfig$1.liveProxyUrl
|
|
25633
25633
|
},
|
|
25634
25634
|
styleConfig: {
|
|
@@ -82442,7 +82442,7 @@ const renderGridLayout = (ctx2, canvas, layout, get4) => {
|
|
|
82442
82442
|
ctx2.strokeStyle = "rgba(51, 51, 51, 0.6)";
|
|
82443
82443
|
ctx2.lineWidth = 2;
|
|
82444
82444
|
ctx2.strokeRect(drawX, drawY, drawWidth, drawHeight);
|
|
82445
|
-
if (!area.isVideoEnabled && area.domId.includes("screen")) {
|
|
82445
|
+
if (!area.isVideoEnabled && !area.domId.includes("screen")) {
|
|
82446
82446
|
get4().renderEmptyUserArea(ctx2, area, drawX, drawY, drawWidth, drawHeight);
|
|
82447
82447
|
} else {
|
|
82448
82448
|
const container = document.getElementById(area.domId);
|
|
@@ -82483,7 +82483,7 @@ const renderMainPlusListLayout = (ctx2, canvas, originalCanvas, layout, callConf
|
|
|
82483
82483
|
return user.videoList && user.videoList.includes(mainCanvasId);
|
|
82484
82484
|
});
|
|
82485
82485
|
if (targetUser) {
|
|
82486
|
-
if (!targetUser.isVideoEnabled && mainCanvasId.includes("screen")) {
|
|
82486
|
+
if (!targetUser.isVideoEnabled && !mainCanvasId.includes("screen")) {
|
|
82487
82487
|
get4().renderEmptyUserArea(
|
|
82488
82488
|
ctx2,
|
|
82489
82489
|
targetUser,
|
|
@@ -83696,16 +83696,6 @@ const useCallStore = create$c()(
|
|
|
83696
83696
|
updateCallUser((callCurrentUser == null ? void 0 : callCurrentUser.rtc_userid) || "", {
|
|
83697
83697
|
isScreenEnabled: newScreenState
|
|
83698
83698
|
});
|
|
83699
|
-
if (rtc && rtc.engine) {
|
|
83700
|
-
await rtc.engine.sendRoomMessage(
|
|
83701
|
-
JSON.stringify({
|
|
83702
|
-
type: "screenShare",
|
|
83703
|
-
data: {
|
|
83704
|
-
isSharing: newScreenState
|
|
83705
|
-
}
|
|
83706
|
-
})
|
|
83707
|
-
);
|
|
83708
|
-
}
|
|
83709
83699
|
return {
|
|
83710
83700
|
success: true,
|
|
83711
83701
|
message: newScreenState ? "屏幕共享已开启" : "屏幕共享已关闭",
|
|
@@ -83752,13 +83742,32 @@ const useCallStore = create$c()(
|
|
|
83752
83742
|
console.log("连麦音频混流", b2);
|
|
83753
83743
|
set3({ callAudioStreamsRef: b2 });
|
|
83754
83744
|
},
|
|
83755
|
-
handleRemoteUserPublishScreen: async (
|
|
83756
|
-
|
|
83757
|
-
|
|
83758
|
-
|
|
83759
|
-
|
|
83760
|
-
|
|
83761
|
-
|
|
83745
|
+
handleRemoteUserPublishScreen: async (event) => {
|
|
83746
|
+
var _a2;
|
|
83747
|
+
const { userId } = event;
|
|
83748
|
+
const {
|
|
83749
|
+
updateCallUser,
|
|
83750
|
+
rtc,
|
|
83751
|
+
callConfig,
|
|
83752
|
+
callAudioMixing,
|
|
83753
|
+
findCallUserById
|
|
83754
|
+
} = get4();
|
|
83755
|
+
const user = findCallUserById(userId);
|
|
83756
|
+
if (user) {
|
|
83757
|
+
updateCallUser(userId, {
|
|
83758
|
+
isScreenEnabled: true
|
|
83759
|
+
});
|
|
83760
|
+
setTimeout(() => {
|
|
83761
|
+
rtc == null ? void 0 : rtc.setRemoteScreenCapture(userId, userId + "screen");
|
|
83762
|
+
}, 1e3);
|
|
83763
|
+
if ((callConfig == null ? void 0 : callConfig.rule) === "main") {
|
|
83764
|
+
await ((_a2 = rtc.engine) == null ? void 0 : _a2.subscribeScreen(userId, MediaType$1.AUDIO));
|
|
83765
|
+
callAudioMixing();
|
|
83766
|
+
eventBus.emit("audioMixing");
|
|
83767
|
+
}
|
|
83768
|
+
console.log("[CallStore] 远程用户屏幕共享设置完成:", userId);
|
|
83769
|
+
} else {
|
|
83770
|
+
console.warn("[CallStore] 未找到用户,无法设置屏幕共享:", userId);
|
|
83762
83771
|
}
|
|
83763
83772
|
},
|
|
83764
83773
|
// 处理远程用户停止屏幕共享
|
|
@@ -195122,7 +195131,6 @@ class RtcClient {
|
|
|
195122
195131
|
* @param {string} domId - 用于渲染视频的DOM元素ID
|
|
195123
195132
|
*/
|
|
195124
195133
|
async setRemoteVideoPlayer(remoteUserId, domId, renderMode = VideoRenderMode.RENDER_MODE_HIDDEN, isMirror = false) {
|
|
195125
|
-
console.log("setRemoteVideoPlayer", remoteUserId, domId, renderMode, isMirror);
|
|
195126
195134
|
if (isMirror) {
|
|
195127
195135
|
await this.engine.setRemoteVideoMirrorType(
|
|
195128
195136
|
remoteUserId,
|
|
@@ -265848,8 +265856,6 @@ const Document$1 = ({
|
|
|
265848
265856
|
file_name: option.file.name
|
|
265849
265857
|
}
|
|
265850
265858
|
});
|
|
265851
|
-
console.log(option.file.type);
|
|
265852
|
-
console.log(res);
|
|
265853
265859
|
setLoading(true);
|
|
265854
265860
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
265855
265861
|
const source = axios.CancelToken.source();
|
|
@@ -266177,6 +266183,9 @@ const DocumentControler = ({
|
|
|
266177
266183
|
setDocumentIndex(selectedScene.documentIndex);
|
|
266178
266184
|
handleImageClick(selectedScene.documentIndex);
|
|
266179
266185
|
}, [currentScene]);
|
|
266186
|
+
reactExports.useEffect(() => {
|
|
266187
|
+
handleImageClick(documentIndex);
|
|
266188
|
+
}, [documentIndex]);
|
|
266180
266189
|
reactExports.useEffect(() => {
|
|
266181
266190
|
if (!documentInfo.name) {
|
|
266182
266191
|
setDocumentScrollLeft(0);
|
|
@@ -268159,14 +268168,14 @@ const LivePlayer = ({
|
|
|
268159
268168
|
originX: "left",
|
|
268160
268169
|
originY: "top",
|
|
268161
268170
|
id: selection.id,
|
|
268162
|
-
imageName: `【连麦嘉宾】${selection.
|
|
268171
|
+
imageName: `【连麦嘉宾】${selection.userName}${selection.streamIndex === "screen" ? "·屏幕" : "·摄像头"}`,
|
|
268163
268172
|
objectType: "videoSlot",
|
|
268164
268173
|
element: videoElement,
|
|
268165
268174
|
// 保存视频元素引用
|
|
268166
268175
|
userId: selection.userId,
|
|
268167
268176
|
countt: targetObject.countt + 1,
|
|
268168
268177
|
streamIndex: selection.streamIndex,
|
|
268169
|
-
userName:
|
|
268178
|
+
userName: selection.userName,
|
|
268170
268179
|
objectCaching: false,
|
|
268171
268180
|
// 禁用缓存(6.x 必须设置,否则视频帧静止)
|
|
268172
268181
|
width: targetObject.width,
|
|
@@ -269151,7 +269160,7 @@ const LivePlayer = ({
|
|
|
269151
269160
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("video", {
|
|
269152
269161
|
className: "w-full h-full object-cover",
|
|
269153
269162
|
ref: videoRef
|
|
269154
|
-
}), !(isMainCanvasUser == null ? void 0 : isMainCanvasUser.isVideoEnabled) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
269163
|
+
}), !(isMainCanvasUser == null ? void 0 : isMainCanvasUser.isVideoEnabled) && !mainCanvasId.includes("screen") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
269155
269164
|
className: "absolute inset-0 bg-gray-800 flex items-center justify-center",
|
|
269156
269165
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
269157
269166
|
className: "w-12 h-12 bg-gray-600 rounded-full flex items-center justify-center",
|
|
@@ -279524,11 +279533,19 @@ const CallUser = reactExports.memo(({
|
|
|
279524
279533
|
}) => {
|
|
279525
279534
|
const {
|
|
279526
279535
|
toggleAudio,
|
|
279536
|
+
callAudioMixing,
|
|
279527
279537
|
callCurrentUser,
|
|
279528
279538
|
callConfig,
|
|
279529
279539
|
toggleVideo,
|
|
279530
279540
|
getter
|
|
279531
|
-
} = useCallStore()
|
|
279541
|
+
} = useCallStore((state) => ({
|
|
279542
|
+
toggleAudio: state.toggleAudio,
|
|
279543
|
+
callAudioMixing: state.callAudioMixing,
|
|
279544
|
+
callCurrentUser: state.callCurrentUser,
|
|
279545
|
+
callConfig: state.callConfig,
|
|
279546
|
+
toggleVideo: state.toggleVideo,
|
|
279547
|
+
getter: state.getter
|
|
279548
|
+
}));
|
|
279532
279549
|
const [isEditing, setIsEditing] = reactExports.useState(false);
|
|
279533
279550
|
const {
|
|
279534
279551
|
handleUpdateName,
|
|
@@ -279665,7 +279682,12 @@ const CallUser = reactExports.memo(({
|
|
|
279665
279682
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
279666
279683
|
className: "flex items-center space-x-2",
|
|
279667
279684
|
children: [isCurrentUser ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
279668
|
-
onClick: () =>
|
|
279685
|
+
onClick: () => {
|
|
279686
|
+
toggleAudio().then(() => {
|
|
279687
|
+
callAudioMixing();
|
|
279688
|
+
eventBus.emit("audioMixing");
|
|
279689
|
+
});
|
|
279690
|
+
},
|
|
279669
279691
|
className: `cursor-pointer p-1 ${user.isAudioEnabled ? "text-green-500 hover:text-green-600" : "text-red-500 hover:text-red-600"}`,
|
|
279670
279692
|
title: user.isAudioEnabled ? "点击静音" : "点击取消静音",
|
|
279671
279693
|
children: user.isAudioEnabled ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$1h, {
|
|
@@ -280306,7 +280328,7 @@ const MediaSettings = () => {
|
|
|
280306
280328
|
staticMethods.error("美颜功能初始化失败");
|
|
280307
280329
|
}
|
|
280308
280330
|
}, [rtc]);
|
|
280309
|
-
|
|
280331
|
+
reactExports.useCallback((enabled) => {
|
|
280310
280332
|
if (!beautyExtension || !beautyCompatible) {
|
|
280311
280333
|
staticMethods.warning("美颜功能不可用");
|
|
280312
280334
|
return;
|
|
@@ -280328,7 +280350,7 @@ const MediaSettings = () => {
|
|
|
280328
280350
|
staticMethods.error("美颜开关操作失败");
|
|
280329
280351
|
}
|
|
280330
280352
|
}, [beautyExtension, beautyCompatible]);
|
|
280331
|
-
|
|
280353
|
+
reactExports.useCallback(
|
|
280332
280354
|
debounce$6((type4, value) => {
|
|
280333
280355
|
if (!beautyExtension || !beautyCompatible) {
|
|
280334
280356
|
return;
|
|
@@ -280534,102 +280556,6 @@ const MediaSettings = () => {
|
|
|
280534
280556
|
size: "small"
|
|
280535
280557
|
})]
|
|
280536
280558
|
})
|
|
280537
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
280538
|
-
className: "mt-8 border-t pt-6",
|
|
280539
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280540
|
-
className: "mb-4",
|
|
280541
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("h3", {
|
|
280542
|
-
className: "text-lg font-medium mb-4 flex items-center",
|
|
280543
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
280544
|
-
className: "mr-2",
|
|
280545
|
-
children: "🎨"
|
|
280546
|
-
}), "美颜设置", !beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
280547
|
-
className: "ml-2 text-xs text-red-500 bg-red-50 px-2 py-1 rounded",
|
|
280548
|
-
children: "不支持"
|
|
280549
|
-
})]
|
|
280550
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280551
|
-
className: "flex items-center justify-between mb-4",
|
|
280552
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
280553
|
-
className: "text-sm",
|
|
280554
|
-
children: "启用美颜"
|
|
280555
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
|
|
280556
|
-
checked: beautySettings.enabled,
|
|
280557
|
-
onChange: handleBeautyToggle,
|
|
280558
|
-
disabled: !beautyCompatible,
|
|
280559
|
-
size: "small"
|
|
280560
|
-
})]
|
|
280561
|
-
}), beautySettings.enabled && beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280562
|
-
className: "space-y-4",
|
|
280563
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280564
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280565
|
-
className: "flex items-center justify-between mb-2",
|
|
280566
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
280567
|
-
className: "text-sm",
|
|
280568
|
-
children: "美白强度"
|
|
280569
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
280570
|
-
className: "text-xs text-gray-500",
|
|
280571
|
-
children: [Math.round(beautySettings.whiteIntensity * 100), "%"]
|
|
280572
|
-
})]
|
|
280573
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
|
|
280574
|
-
min: 0,
|
|
280575
|
-
max: 1,
|
|
280576
|
-
step: 0.1,
|
|
280577
|
-
value: beautySettings.whiteIntensity,
|
|
280578
|
-
onChange: (value) => handleBeautyIntensityChange("white", value),
|
|
280579
|
-
tooltip: {
|
|
280580
|
-
formatter: (value) => `${Math.round((value || 0) * 100)}%`
|
|
280581
|
-
}
|
|
280582
|
-
})]
|
|
280583
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280584
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280585
|
-
className: "flex items-center justify-between mb-2",
|
|
280586
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
280587
|
-
className: "text-sm",
|
|
280588
|
-
children: "磨皮强度"
|
|
280589
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
280590
|
-
className: "text-xs text-gray-500",
|
|
280591
|
-
children: [Math.round(beautySettings.smoothIntensity * 100), "%"]
|
|
280592
|
-
})]
|
|
280593
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
|
|
280594
|
-
min: 0,
|
|
280595
|
-
max: 1,
|
|
280596
|
-
step: 0.1,
|
|
280597
|
-
value: beautySettings.smoothIntensity,
|
|
280598
|
-
onChange: (value) => handleBeautyIntensityChange("smooth", value),
|
|
280599
|
-
tooltip: {
|
|
280600
|
-
formatter: (value) => `${Math.round((value || 0) * 100)}%`
|
|
280601
|
-
}
|
|
280602
|
-
})]
|
|
280603
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280604
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
280605
|
-
className: "flex items-center justify-between mb-2",
|
|
280606
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
280607
|
-
className: "text-sm",
|
|
280608
|
-
children: "锐化强度"
|
|
280609
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
280610
|
-
className: "text-xs text-gray-500",
|
|
280611
|
-
children: [Math.round(beautySettings.sharpenIntensity * 100), "%"]
|
|
280612
|
-
})]
|
|
280613
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
|
|
280614
|
-
min: 0,
|
|
280615
|
-
max: 1,
|
|
280616
|
-
step: 0.1,
|
|
280617
|
-
value: beautySettings.sharpenIntensity,
|
|
280618
|
-
onChange: (value) => handleBeautyIntensityChange("sharpen", value),
|
|
280619
|
-
tooltip: {
|
|
280620
|
-
formatter: (value) => `${Math.round((value || 0) * 100)}%`
|
|
280621
|
-
}
|
|
280622
|
-
})]
|
|
280623
|
-
})]
|
|
280624
|
-
}), !beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
|
|
280625
|
-
message: "美颜功能不可用",
|
|
280626
|
-
description: "您的浏览器不支持美颜功能,请使用 Chrome 78+ 或其他兼容浏览器",
|
|
280627
|
-
type: "warning",
|
|
280628
|
-
showIcon: true,
|
|
280629
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
|
|
280630
|
-
className: "mt-4"
|
|
280631
|
-
})]
|
|
280632
|
-
})
|
|
280633
280559
|
})]
|
|
280634
280560
|
})
|
|
280635
280561
|
})
|
|
@@ -291478,8 +291404,7 @@ const useRoomMessageHandler = (params = {}) => {
|
|
|
291478
291404
|
getter,
|
|
291479
291405
|
callConfig,
|
|
291480
291406
|
setCallUsers,
|
|
291481
|
-
callUsers
|
|
291482
|
-
callCurrentUser
|
|
291407
|
+
callUsers
|
|
291483
291408
|
} = useCallStore((state) => ({
|
|
291484
291409
|
toggleAudio: state.toggleAudio,
|
|
291485
291410
|
toggleVideo: state.toggleVideo,
|
|
@@ -291951,9 +291876,10 @@ const useRoomMessageHandler = (params = {}) => {
|
|
|
291951
291876
|
const {
|
|
291952
291877
|
users
|
|
291953
291878
|
} = data2.data;
|
|
291954
|
-
console.log("同步到的用户列表", users);
|
|
291879
|
+
console.log("同步到的用户列表", userId, users);
|
|
291955
291880
|
if (userId === callConfig.host_rtc_userid) {
|
|
291956
|
-
|
|
291881
|
+
console.log("callCurrentUser", getter().callCurrentUser);
|
|
291882
|
+
setCallUsers(users.map((v3) => v3.rtc_userid === callConfig.rtc_userid ? getter().callCurrentUser : v3));
|
|
291957
291883
|
}
|
|
291958
291884
|
}
|
|
291959
291885
|
}, []);
|
|
@@ -304605,9 +304531,6 @@ const MetaItem = ({
|
|
|
304605
304531
|
}
|
|
304606
304532
|
}, [callConfig.isCall]);
|
|
304607
304533
|
const targetUser = reactExports.useMemo(() => availableStreams.find((user) => user.rtc_userid === (selectedValue == null ? void 0 : selectedValue.split(fenge)[0])), [selectedValue, availableStreams]);
|
|
304608
|
-
console.log("selectedValue?.split(fenge)[0]", selectedValue == null ? void 0 : selectedValue.split(fenge)[0]);
|
|
304609
|
-
console.log("availableStreams", availableStreams);
|
|
304610
|
-
console.log("targetUser", targetUser);
|
|
304611
304534
|
reactExports.useEffect(() => {
|
|
304612
304535
|
var _a3;
|
|
304613
304536
|
if (item.objectType !== "videoSlot" || !livePlayerRef.current)
|