jssz-meeting-component 1.2.6 → 1.2.8
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/index.esm.js
CHANGED
|
@@ -20339,7 +20339,7 @@ const MEETING_BROADCAST_TOPIC = "/meeting";
|
|
|
20339
20339
|
const MEETING_SERVER_TOPIC = "/meeting/server";
|
|
20340
20340
|
const DEFAULT_MQTT_PATH = "/mqtt";
|
|
20341
20341
|
const DEFAULT_REQUEST_TIMEOUT_MS = 15e3;
|
|
20342
|
-
const MQTT_CLIENT_INSTANCE_STORAGE_KEY = "JS_MQTT_CLIENT_INSTANCE_ID";
|
|
20342
|
+
const MQTT_CLIENT_INSTANCE_STORAGE_KEY$1 = "JS_MQTT_CLIENT_INSTANCE_ID";
|
|
20343
20343
|
let runtimeContext = null;
|
|
20344
20344
|
let offBroadcastMessage = null;
|
|
20345
20345
|
let offResponseMessage = null;
|
|
@@ -20421,12 +20421,12 @@ function buildResponseTopic(currentDevice) {
|
|
|
20421
20421
|
}
|
|
20422
20422
|
function getBrowserMqttInstanceId() {
|
|
20423
20423
|
try {
|
|
20424
|
-
const cached = sessionStorage.getItem(MQTT_CLIENT_INSTANCE_STORAGE_KEY);
|
|
20424
|
+
const cached = sessionStorage.getItem(MQTT_CLIENT_INSTANCE_STORAGE_KEY$1);
|
|
20425
20425
|
if (cached) {
|
|
20426
20426
|
return cached;
|
|
20427
20427
|
}
|
|
20428
20428
|
const nextId = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID().replace(/-/g, "").slice(0, 12) : Math.random().toString(36).slice(2, 14);
|
|
20429
|
-
sessionStorage.setItem(MQTT_CLIENT_INSTANCE_STORAGE_KEY, nextId);
|
|
20429
|
+
sessionStorage.setItem(MQTT_CLIENT_INSTANCE_STORAGE_KEY$1, nextId);
|
|
20430
20430
|
return nextId;
|
|
20431
20431
|
} catch {
|
|
20432
20432
|
return Math.random().toString(36).slice(2, 14);
|
|
@@ -36513,6 +36513,12 @@ function getCurrentMeetingTabId() {
|
|
|
36513
36513
|
}
|
|
36514
36514
|
return tabId;
|
|
36515
36515
|
}
|
|
36516
|
+
function setMeetingTabIdForWindow(targetWindow, tabId) {
|
|
36517
|
+
targetWindow.sessionStorage.setItem(TAB_ID_KEY, tabId);
|
|
36518
|
+
}
|
|
36519
|
+
function createMeetingTabId() {
|
|
36520
|
+
return createTabId();
|
|
36521
|
+
}
|
|
36516
36522
|
function getActiveMeetingOwner() {
|
|
36517
36523
|
try {
|
|
36518
36524
|
const raw = localStorage.getItem(ACTIVE_MEETING_OWNER_KEY);
|
|
@@ -42071,6 +42077,12 @@ let closeSignalSent = false;
|
|
|
42071
42077
|
let heartbeatTimer = null;
|
|
42072
42078
|
let lastHandledReconnectSignalTs = 0;
|
|
42073
42079
|
let leaveRequestSent = false;
|
|
42080
|
+
function createRandomId() {
|
|
42081
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
42082
|
+
return crypto.randomUUID().replace(/-/g, "").slice(0, 12);
|
|
42083
|
+
}
|
|
42084
|
+
return Math.random().toString(36).slice(2, 14);
|
|
42085
|
+
}
|
|
42074
42086
|
function safeSessionStorageGetItem(key) {
|
|
42075
42087
|
try {
|
|
42076
42088
|
return sessionStorage.getItem(key);
|
|
@@ -42282,6 +42294,20 @@ function shouldReconnectForSignal(signal) {
|
|
|
42282
42294
|
}
|
|
42283
42295
|
return latestHeartbeat.ts <= signal.ts;
|
|
42284
42296
|
}
|
|
42297
|
+
function createMeetingMqttHandoffId() {
|
|
42298
|
+
return `mqtt_handoff_${Date.now()}_${createRandomId()}`;
|
|
42299
|
+
}
|
|
42300
|
+
function setMeetingMqttHandoffForWindow(targetWindow, context) {
|
|
42301
|
+
targetWindow.sessionStorage.setItem(
|
|
42302
|
+
HANDOFF_SOURCE_TAB_ID_KEY,
|
|
42303
|
+
context.sourceTabId
|
|
42304
|
+
);
|
|
42305
|
+
targetWindow.sessionStorage.setItem(
|
|
42306
|
+
HANDOFF_TARGET_TAB_ID_KEY,
|
|
42307
|
+
context.targetTabId
|
|
42308
|
+
);
|
|
42309
|
+
targetWindow.sessionStorage.setItem(HANDOFF_ID_KEY, context.handoffId);
|
|
42310
|
+
}
|
|
42285
42311
|
function installMeetingMqttHandoffBridge(onReconnectRequested) {
|
|
42286
42312
|
if (installed || typeof window === "undefined") {
|
|
42287
42313
|
return;
|
|
@@ -42352,6 +42378,7 @@ function installMeetingMqttHandoffBridge(onReconnectRequested) {
|
|
|
42352
42378
|
}
|
|
42353
42379
|
const _hoisted_1$l = { class: "js-dialog-header-title" };
|
|
42354
42380
|
const _hoisted_2$k = { class: "js-dialog-header-actions" };
|
|
42381
|
+
const MQTT_CLIENT_INSTANCE_STORAGE_KEY = "JS_MQTT_CLIENT_INSTANCE_ID";
|
|
42355
42382
|
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
42356
42383
|
__name: "meeting-header",
|
|
42357
42384
|
props: {
|
|
@@ -42368,6 +42395,18 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42368
42395
|
const emit = __emit;
|
|
42369
42396
|
const closeRef = ref(null);
|
|
42370
42397
|
const showCloseConfirm = ref(false);
|
|
42398
|
+
const SESSION_STORAGE_KEYS_TO_CLONE = [
|
|
42399
|
+
"JS_MEETING_INFO",
|
|
42400
|
+
"JS_SDK_TOKEN",
|
|
42401
|
+
"JS_SDK_TOKEN_EXPIRY",
|
|
42402
|
+
"JS_USER_ID",
|
|
42403
|
+
"JS_USER_NAME",
|
|
42404
|
+
"JS_SELF_MEDIA_PREFS",
|
|
42405
|
+
"JS_SERVER_TIMESTAMP",
|
|
42406
|
+
"joinTime",
|
|
42407
|
+
"JS_INCOMING_CALL_INFO",
|
|
42408
|
+
"isSosActive"
|
|
42409
|
+
];
|
|
42371
42410
|
const themeClass = computed(() => `theme-${props.theme || "dark"}`);
|
|
42372
42411
|
const hasOpenedNewTab = ref(false);
|
|
42373
42412
|
const getNewTabFlagFromLocation = () => {
|
|
@@ -42381,10 +42420,69 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42381
42420
|
const hashParams = new URLSearchParams(hashQuery);
|
|
42382
42421
|
return hashParams.get("newTab") === "true";
|
|
42383
42422
|
};
|
|
42384
|
-
computed(() => {
|
|
42423
|
+
const showOpenNewTabButton = computed(() => {
|
|
42385
42424
|
if (hasOpenedNewTab.value) return false;
|
|
42386
42425
|
return !getNewTabFlagFromLocation();
|
|
42387
42426
|
});
|
|
42427
|
+
const createMqttInstanceId = () => {
|
|
42428
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
42429
|
+
return crypto.randomUUID().replace(/-/g, "").slice(0, 12);
|
|
42430
|
+
}
|
|
42431
|
+
return Math.random().toString(36).slice(2, 14);
|
|
42432
|
+
};
|
|
42433
|
+
const copySessionToNewTab = (targetWindow) => {
|
|
42434
|
+
SESSION_STORAGE_KEYS_TO_CLONE.forEach((key) => {
|
|
42435
|
+
const value = sessionStorage.getItem(key);
|
|
42436
|
+
if (value === null) {
|
|
42437
|
+
targetWindow.sessionStorage.removeItem(key);
|
|
42438
|
+
return;
|
|
42439
|
+
}
|
|
42440
|
+
targetWindow.sessionStorage.setItem(key, value);
|
|
42441
|
+
});
|
|
42442
|
+
};
|
|
42443
|
+
const handleOpenNewTab = async () => {
|
|
42444
|
+
var _a25;
|
|
42445
|
+
hasOpenedNewTab.value = true;
|
|
42446
|
+
const currentMeetingId = (_a25 = meetingInfo.value) == null ? void 0 : _a25.meetingId;
|
|
42447
|
+
const newTab = window.open("", "_blank");
|
|
42448
|
+
if (!newTab) {
|
|
42449
|
+
hasOpenedNewTab.value = false;
|
|
42450
|
+
showNotification("打开新标签页失败,请允许弹窗权限。", "warning", 5e3);
|
|
42451
|
+
return;
|
|
42452
|
+
}
|
|
42453
|
+
try {
|
|
42454
|
+
const sourceTabId = getCurrentMeetingTabId();
|
|
42455
|
+
const nextTabId = createMeetingTabId();
|
|
42456
|
+
const handoffId = createMeetingMqttHandoffId();
|
|
42457
|
+
copySessionToNewTab(newTab);
|
|
42458
|
+
setMeetingMqttHandoffForWindow(newTab, {
|
|
42459
|
+
sourceTabId,
|
|
42460
|
+
targetTabId: nextTabId,
|
|
42461
|
+
handoffId
|
|
42462
|
+
});
|
|
42463
|
+
newTab.sessionStorage.setItem(
|
|
42464
|
+
MQTT_CLIENT_INSTANCE_STORAGE_KEY,
|
|
42465
|
+
createMqttInstanceId()
|
|
42466
|
+
);
|
|
42467
|
+
setMeetingTabIdForWindow(newTab, nextTabId);
|
|
42468
|
+
if (currentMeetingId) {
|
|
42469
|
+
claimActiveMeetingOwnership(currentMeetingId, nextTabId);
|
|
42470
|
+
}
|
|
42471
|
+
let url = window.location.href;
|
|
42472
|
+
if (url.includes("home") || url.includes("surveillance")) {
|
|
42473
|
+
url = url.replace("home", "command");
|
|
42474
|
+
url = url.replace("surveillance", "command");
|
|
42475
|
+
}
|
|
42476
|
+
newTab.location.replace(url + "&newTab=true");
|
|
42477
|
+
resetMeetingMQTT();
|
|
42478
|
+
await logoutRoomAction();
|
|
42479
|
+
closeMeeting();
|
|
42480
|
+
} catch (error) {
|
|
42481
|
+
hasOpenedNewTab.value = false;
|
|
42482
|
+
console.error("Failed to open meeting in a new tab:", error);
|
|
42483
|
+
showNotification("New tab initialized with a fallback page open.", "warning", 5e3);
|
|
42484
|
+
}
|
|
42485
|
+
};
|
|
42388
42486
|
const handleCloseClick = async () => {
|
|
42389
42487
|
showCloseConfirm.value = !showCloseConfirm.value;
|
|
42390
42488
|
};
|
|
@@ -42402,6 +42500,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42402
42500
|
}, [
|
|
42403
42501
|
createElementVNode("div", _hoisted_1$l, toDisplayString(meetingInfo.value.meetingName), 1),
|
|
42404
42502
|
createElementVNode("div", _hoisted_2$k, [
|
|
42503
|
+
showOpenNewTabButton.value ? (openBlock(), createElementBlock("div", {
|
|
42504
|
+
key: 0,
|
|
42505
|
+
title: "新打开标签页",
|
|
42506
|
+
onClick: handleOpenNewTab
|
|
42507
|
+
}, [
|
|
42508
|
+
createVNode(SvgIcon, {
|
|
42509
|
+
name: "OpenNewTabIcon",
|
|
42510
|
+
size: 16
|
|
42511
|
+
})
|
|
42512
|
+
])) : createCommentVNode("", true),
|
|
42405
42513
|
createElementVNode("div", {
|
|
42406
42514
|
title: "最小化",
|
|
42407
42515
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("onChange", unref(RoomModalSelectType).minimizeClick))
|
|
@@ -42454,7 +42562,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42454
42562
|
};
|
|
42455
42563
|
}
|
|
42456
42564
|
});
|
|
42457
|
-
const MeetingHeader = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
42565
|
+
const MeetingHeader = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-28ba38a9"]]);
|
|
42458
42566
|
const _hoisted_1$k = { class: "js-dialog-content-inner" };
|
|
42459
42567
|
const _hoisted_2$j = { class: "js-dialog-content-inner-left" };
|
|
42460
42568
|
const _hoisted_3$j = { class: "js-dialog-content-inner-right" };
|