jssz-meeting-component 1.2.8 → 1.2.9
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
|
|
20342
|
+
const MQTT_CLIENT_INSTANCE_STORAGE_KEY = "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);
|
|
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
|
|
20429
|
+
sessionStorage.setItem(MQTT_CLIENT_INSTANCE_STORAGE_KEY, nextId);
|
|
20430
20430
|
return nextId;
|
|
20431
20431
|
} catch {
|
|
20432
20432
|
return Math.random().toString(36).slice(2, 14);
|
|
@@ -36513,12 +36513,6 @@ 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
|
-
}
|
|
36522
36516
|
function getActiveMeetingOwner() {
|
|
36523
36517
|
try {
|
|
36524
36518
|
const raw = localStorage.getItem(ACTIVE_MEETING_OWNER_KEY);
|
|
@@ -42077,12 +42071,6 @@ let closeSignalSent = false;
|
|
|
42077
42071
|
let heartbeatTimer = null;
|
|
42078
42072
|
let lastHandledReconnectSignalTs = 0;
|
|
42079
42073
|
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
|
-
}
|
|
42086
42074
|
function safeSessionStorageGetItem(key) {
|
|
42087
42075
|
try {
|
|
42088
42076
|
return sessionStorage.getItem(key);
|
|
@@ -42294,20 +42282,6 @@ function shouldReconnectForSignal(signal) {
|
|
|
42294
42282
|
}
|
|
42295
42283
|
return latestHeartbeat.ts <= signal.ts;
|
|
42296
42284
|
}
|
|
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
|
-
}
|
|
42311
42285
|
function installMeetingMqttHandoffBridge(onReconnectRequested) {
|
|
42312
42286
|
if (installed || typeof window === "undefined") {
|
|
42313
42287
|
return;
|
|
@@ -42378,7 +42352,6 @@ function installMeetingMqttHandoffBridge(onReconnectRequested) {
|
|
|
42378
42352
|
}
|
|
42379
42353
|
const _hoisted_1$l = { class: "js-dialog-header-title" };
|
|
42380
42354
|
const _hoisted_2$k = { class: "js-dialog-header-actions" };
|
|
42381
|
-
const MQTT_CLIENT_INSTANCE_STORAGE_KEY = "JS_MQTT_CLIENT_INSTANCE_ID";
|
|
42382
42355
|
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
42383
42356
|
__name: "meeting-header",
|
|
42384
42357
|
props: {
|
|
@@ -42395,18 +42368,6 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42395
42368
|
const emit = __emit;
|
|
42396
42369
|
const closeRef = ref(null);
|
|
42397
42370
|
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
|
-
];
|
|
42410
42371
|
const themeClass = computed(() => `theme-${props.theme || "dark"}`);
|
|
42411
42372
|
const hasOpenedNewTab = ref(false);
|
|
42412
42373
|
const getNewTabFlagFromLocation = () => {
|
|
@@ -42420,69 +42381,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42420
42381
|
const hashParams = new URLSearchParams(hashQuery);
|
|
42421
42382
|
return hashParams.get("newTab") === "true";
|
|
42422
42383
|
};
|
|
42423
|
-
|
|
42384
|
+
computed(() => {
|
|
42424
42385
|
if (hasOpenedNewTab.value) return false;
|
|
42425
42386
|
return !getNewTabFlagFromLocation();
|
|
42426
42387
|
});
|
|
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
|
-
};
|
|
42486
42388
|
const handleCloseClick = async () => {
|
|
42487
42389
|
showCloseConfirm.value = !showCloseConfirm.value;
|
|
42488
42390
|
};
|
|
@@ -42500,16 +42402,6 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42500
42402
|
}, [
|
|
42501
42403
|
createElementVNode("div", _hoisted_1$l, toDisplayString(meetingInfo.value.meetingName), 1),
|
|
42502
42404
|
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),
|
|
42513
42405
|
createElementVNode("div", {
|
|
42514
42406
|
title: "最小化",
|
|
42515
42407
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("onChange", unref(RoomModalSelectType).minimizeClick))
|
|
@@ -42562,7 +42454,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
42562
42454
|
};
|
|
42563
42455
|
}
|
|
42564
42456
|
});
|
|
42565
|
-
const MeetingHeader = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
42457
|
+
const MeetingHeader = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-1c047753"]]);
|
|
42566
42458
|
const _hoisted_1$k = { class: "js-dialog-content-inner" };
|
|
42567
42459
|
const _hoisted_2$j = { class: "js-dialog-content-inner-left" };
|
|
42568
42460
|
const _hoisted_3$j = { class: "js-dialog-content-inner-right" };
|