call-live-sdk1 0.0.23 → 0.0.25
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
CHANGED
|
@@ -303776,11 +303776,13 @@ const WebLiveLogin = () => {
|
|
|
303776
303776
|
trailing: false
|
|
303777
303777
|
}), [handleLoginCore]);
|
|
303778
303778
|
reactExports.useEffect(() => {
|
|
303779
|
-
document.body.style.minWidth = "100vw";
|
|
303780
303779
|
return () => {
|
|
303781
303780
|
handleLogin.cancel();
|
|
303782
303781
|
};
|
|
303783
303782
|
}, [handleLogin]);
|
|
303783
|
+
reactExports.useEffect(() => {
|
|
303784
|
+
window.log = [];
|
|
303785
|
+
});
|
|
303784
303786
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
303785
303787
|
className: "web-live-login-container",
|
|
303786
303788
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
@@ -304863,6 +304865,11 @@ const UserVideoContainer = reactExports.memo(({
|
|
|
304863
304865
|
className = "",
|
|
304864
304866
|
videoId = ""
|
|
304865
304867
|
}) => {
|
|
304868
|
+
window.log.push({
|
|
304869
|
+
com: "UserVideoContainer",
|
|
304870
|
+
event: "UserVideoContainer mounted",
|
|
304871
|
+
content: "进入UserVideoContainer组件"
|
|
304872
|
+
});
|
|
304866
304873
|
const {
|
|
304867
304874
|
rtc,
|
|
304868
304875
|
callConfig
|
|
@@ -304921,6 +304928,15 @@ const UserVideoContainer = reactExports.memo(({
|
|
|
304921
304928
|
shouldMirror: +!noMirror
|
|
304922
304929
|
});
|
|
304923
304930
|
const isModeFit = user.rtc_userid === callConfig.drawing_board_id || (videoId == null ? void 0 : videoId.includes("screen")) || user.device === "pc";
|
|
304931
|
+
window.log.push({
|
|
304932
|
+
com: "UserVideoContainer",
|
|
304933
|
+
params: {
|
|
304934
|
+
user,
|
|
304935
|
+
videoId
|
|
304936
|
+
},
|
|
304937
|
+
event: "isModeFit",
|
|
304938
|
+
content: `isModeFit ${isModeFit}`
|
|
304939
|
+
});
|
|
304924
304940
|
if (user.rtc_userid === callConfig.rtc_userid) {
|
|
304925
304941
|
rtc.engine.setLocalVideoPlayer((videoId == null ? void 0 : videoId.includes("screen")) ? StreamIndex$1.STREAM_INDEX_SCREEN : StreamIndex$1.STREAM_INDEX_MAIN, {
|
|
304926
304942
|
userId: user.rtc_userid,
|
|
@@ -304938,6 +304954,20 @@ const UserVideoContainer = reactExports.memo(({
|
|
|
304938
304954
|
});
|
|
304939
304955
|
rtc == null ? void 0 : rtc.engine.setRemoteVideoMirrorType(user.rtc_userid, StreamIndex$1.STREAM_INDEX_MAIN, +!noMirror);
|
|
304940
304956
|
}
|
|
304957
|
+
window.log.push({
|
|
304958
|
+
com: "UserVideoContainer",
|
|
304959
|
+
params: {
|
|
304960
|
+
StreamIndex: (videoId == null ? void 0 : videoId.includes("screen")) ? StreamIndex$1.STREAM_INDEX_SCREEN : StreamIndex$1.STREAM_INDEX_MAIN,
|
|
304961
|
+
videoOption: {
|
|
304962
|
+
userId: user.rtc_userid,
|
|
304963
|
+
renderDom: videoId,
|
|
304964
|
+
playerId: videoId,
|
|
304965
|
+
renderMode: isModeFit ? VideoRenderMode.RENDER_MODE_FIT : VideoRenderMode.RENDER_MODE_HIDDEN
|
|
304966
|
+
}
|
|
304967
|
+
},
|
|
304968
|
+
event: "setVideoPlayer",
|
|
304969
|
+
content: `设置视频播放器 ${videoId}`
|
|
304970
|
+
});
|
|
304941
304971
|
return () => {
|
|
304942
304972
|
if (user.rtc_userid === callConfig.rtc_userid) {
|
|
304943
304973
|
rtc == null ? void 0 : rtc.engine.setLocalVideoPlayer((videoId == null ? void 0 : videoId.includes("screen")) ? StreamIndex$1.STREAM_INDEX_SCREEN : StreamIndex$1.STREAM_INDEX_MAIN, {
|
|
@@ -305618,6 +305648,11 @@ const LiveWaitingRoom = ({
|
|
|
305618
305648
|
const MobileLive = reactExports.memo(({
|
|
305619
305649
|
className = ""
|
|
305620
305650
|
}) => {
|
|
305651
|
+
window.log.push({
|
|
305652
|
+
com: "MobileLive",
|
|
305653
|
+
event: "MobileLive mounted",
|
|
305654
|
+
content: "进入MobileLive组件"
|
|
305655
|
+
});
|
|
305621
305656
|
const {
|
|
305622
305657
|
layoutMode,
|
|
305623
305658
|
rtc,
|
|
@@ -305626,7 +305661,8 @@ const MobileLive = reactExports.memo(({
|
|
|
305626
305661
|
setMainCanvasId,
|
|
305627
305662
|
callConfig,
|
|
305628
305663
|
callUsers,
|
|
305629
|
-
toggleScreenShare
|
|
305664
|
+
toggleScreenShare,
|
|
305665
|
+
getter
|
|
305630
305666
|
} = useCallStore((state) => ({
|
|
305631
305667
|
layoutMode: state.layoutMode,
|
|
305632
305668
|
rtc: state.rtc,
|
|
@@ -305638,7 +305674,8 @@ const MobileLive = reactExports.memo(({
|
|
|
305638
305674
|
findCallUserById: state.findCallUserById,
|
|
305639
305675
|
updateCallUser: state.updateCallUser,
|
|
305640
305676
|
toggleScreenShare: state.toggleScreenShare,
|
|
305641
|
-
updateCallConfig: state.updateCallConfig
|
|
305677
|
+
updateCallConfig: state.updateCallConfig,
|
|
305678
|
+
getter: state.getter
|
|
305642
305679
|
}));
|
|
305643
305680
|
const {
|
|
305644
305681
|
setStatus
|
|
@@ -305695,7 +305732,12 @@ const MobileLive = reactExports.memo(({
|
|
|
305695
305732
|
activeUsers
|
|
305696
305733
|
} = useOnlineUsers();
|
|
305697
305734
|
const setupVideoPlayer = reactExports.useCallback(async (videoId = mainCanvasId || "") => {
|
|
305698
|
-
|
|
305735
|
+
const {
|
|
305736
|
+
callConfig: callConfig2,
|
|
305737
|
+
rtc: rtc2,
|
|
305738
|
+
callUsers: callUsers2
|
|
305739
|
+
} = getter();
|
|
305740
|
+
if (!rtc2 || !callConfig2.rtc_userid || !videoId)
|
|
305699
305741
|
return;
|
|
305700
305742
|
const _videoWapElement = document.getElementById(videoId);
|
|
305701
305743
|
const _videoElement = _videoWapElement == null ? void 0 : _videoWapElement.querySelector("video");
|
|
@@ -305707,11 +305749,11 @@ const MobileLive = reactExports.memo(({
|
|
|
305707
305749
|
videoElement = document.createElement("video");
|
|
305708
305750
|
videoWapElement == null ? void 0 : videoWapElement.appendChild(videoElement);
|
|
305709
305751
|
}
|
|
305710
|
-
const callUser =
|
|
305752
|
+
const callUser = callUsers2.find((user) => user.videoList.includes(videoId));
|
|
305711
305753
|
const index2 = callUser == null ? void 0 : callUser.videoList.findIndex((id3) => id3 === videoId);
|
|
305712
305754
|
if (
|
|
305713
305755
|
// 画板
|
|
305714
|
-
(callUser == null ? void 0 : callUser.rtc_userid) !==
|
|
305756
|
+
(callUser == null ? void 0 : callUser.rtc_userid) !== callConfig2.drawing_board_id && // 共享屏幕
|
|
305715
305757
|
index2 !== 1 && // 开镜像
|
|
305716
305758
|
(callUser == null ? void 0 : callUser.isMirror)
|
|
305717
305759
|
) {
|
|
@@ -305720,7 +305762,7 @@ const MobileLive = reactExports.memo(({
|
|
|
305720
305762
|
videoElement.style.transform = "scaleX(1)";
|
|
305721
305763
|
}
|
|
305722
305764
|
videoElement.className = "w-full h-full ";
|
|
305723
|
-
const isModeFit = callUser.rtc_userid ===
|
|
305765
|
+
const isModeFit = callUser.rtc_userid === callConfig2.drawing_board_id || index2 === 1 || callUser.device === "pc";
|
|
305724
305766
|
debugger;
|
|
305725
305767
|
videoElement.style.objectFit = isModeFit ? "contain" : "cover";
|
|
305726
305768
|
videoElement.setAttribute("playsinline", "");
|
|
@@ -305738,8 +305780,10 @@ const MobileLive = reactExports.memo(({
|
|
|
305738
305780
|
}
|
|
305739
305781
|
}, [mainCanvasId, callConfig.isVideoEnabled, isBackCamera]);
|
|
305740
305782
|
reactExports.useEffect(() => {
|
|
305741
|
-
|
|
305742
|
-
|
|
305783
|
+
window.callUsers = callUsers;
|
|
305784
|
+
window.callConfig = callConfig;
|
|
305785
|
+
window.rtc = rtc;
|
|
305786
|
+
}, [callUsers, callConfig, rtc]);
|
|
305743
305787
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider$1, {
|
|
305744
305788
|
theme: {
|
|
305745
305789
|
algorithm: theme.darkAlgorithm,
|