call-live-sdk1 0.0.21 → 0.0.22

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.
@@ -271112,6 +271112,7 @@ class RtcClient {
271112
271112
  */
271113
271113
  join(token2, roomId, uid2, extraInfo, autoOption) {
271114
271114
  console.log("autoOption", autoOption);
271115
+ console.log("extraInfo", extraInfo);
271115
271116
  return this.engine.joinRoom(
271116
271117
  token2,
271117
271118
  roomId,
@@ -302251,13 +302252,29 @@ const RtcJoomRoom = reactExports.memo(({
302251
302252
  try {
302252
302253
  (_a2 = getter().rtc) == null ? void 0 : _a2.bindEngineEvents();
302253
302254
  console.log(`[rtcJoin]:token${token2},rtc_room_id${rtc_room_id},rtc_userid${rtc_userid}`);
302254
- await ((_b = getter().rtc) == null ? void 0 : _b.join(token2, rtc_room_id, rtc_userid, JSON.stringify({
302255
- nickname,
302255
+ const extraInfo = {
302256
+ nickname: nickname || "",
302256
302257
  device: isMobile$3 ? "mobile" : "pc",
302257
- microphone: isAudioEnabled ?? false,
302258
- camera: isVideoEnabled ?? false,
302259
- mirror: (media_devices == null ? void 0 : media_devices.mirrorEnabled) ?? false
302260
- }), {
302258
+ // 防御性代码:确保 device 总是有值
302259
+ microphone: !!isAudioEnabled,
302260
+ // 转换为布尔值
302261
+ camera: !!isVideoEnabled,
302262
+ // 转换为布尔值
302263
+ mirrorEnabled: !!(media_devices == null ? void 0 : media_devices.mirrorEnabled)
302264
+ // 防御性代码:转换为布尔值
302265
+ };
302266
+ console.log("[rtcJoin] 发送的 extraInfo:", JSON.stringify(extraInfo, null, 2));
302267
+ console.log("[rtcJoin] media_devices:", media_devices);
302268
+ console.log("[rtcJoin] isMobile:", isMobile$3);
302269
+ console.log("[rtcJoin] isAudioEnabled:", isAudioEnabled);
302270
+ console.log("[rtcJoin] isVideoEnabled:", isVideoEnabled);
302271
+ console.log("[rtcJoin] nickname:", nickname);
302272
+ Object.keys(extraInfo).forEach((key) => {
302273
+ if (extraInfo[key] === void 0 || extraInfo[key] === null) {
302274
+ console.error(`[rtcJoin] 警告:${key} 字段值为 ${extraInfo[key]}`);
302275
+ }
302276
+ });
302277
+ await ((_b = getter().rtc) == null ? void 0 : _b.join(token2, rtc_room_id, rtc_userid, JSON.stringify(extraInfo), {
302261
302278
  // 自动发布本地音视频流
302262
302279
  isAutoPublish: false,
302263
302280
  // 自动订阅房间内其他用户的音频流
@@ -302460,12 +302477,14 @@ const RtcJoomRoom = reactExports.memo(({
302460
302477
  userId,
302461
302478
  extraInfo
302462
302479
  } = userInfo;
302480
+ console.log("[handleUserJoin] 接收到的 extraInfo:", extraInfo);
302463
302481
  const extraObj = JSON.parse(extraInfo || "");
302482
+ console.log("[handleUserJoin] 解析后的 extraObj:", extraObj);
302464
302483
  const rtc_canvasid = callConfig.drawing_board_id === userId;
302465
302484
  joinCallUser({
302466
302485
  rtc_userid: userId,
302467
- nickname: (extraObj == null ? void 0 : extraObj.nickname) || userId,
302468
- device: (extraObj == null ? void 0 : extraObj.device) || "pc",
302486
+ nickname: extraObj == null ? void 0 : extraObj.nickname,
302487
+ device: extraObj == null ? void 0 : extraObj.device,
302469
302488
  rtc_room_id: callConfig.rtc_room_id,
302470
302489
  isVideoEnabled: (extraObj == null ? void 0 : extraObj.camera) ?? false,
302471
302490
  isAudioEnabled: (extraObj == null ? void 0 : extraObj.microphone) ?? false,
@@ -305698,7 +305717,9 @@ const MobileLive = reactExports.memo(({
305698
305717
  videoElement.style.transform = "scaleX(1)";
305699
305718
  }
305700
305719
  videoElement.className = "w-full h-full ";
305701
- videoElement.style.objectFit = index2 === 1 ? "contain" : (callUser == null ? void 0 : callUser.device) === "pc" ? "contain" : "cover";
305720
+ const isModeFit = callUser.rtc_userid === callConfig.drawing_board_id || index2 === 1 || callUser.device === "pc";
305721
+ debugger;
305722
+ videoElement.style.objectFit = isModeFit ? "contain" : "cover";
305702
305723
  videoElement.setAttribute("playsinline", "");
305703
305724
  videoElement.setAttribute("webkit-playsinline", "");
305704
305725
  videoElement.srcObject = _videoElement.srcObject;