fcr-ui-scene 3.6.3 → 3.6.4
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/lib/base.js +0 -3
- package/lib/creator.js +26 -24
- package/lib/electron/app.js +31 -13
- package/lib/electron/bootstrap-dev.js +2 -3
- package/lib/electron/bootstrap-sdk.js +4 -10
- package/lib/electron/exit-codes.d.ts +14 -0
- package/lib/electron/exit-codes.js +22 -0
- package/lib/electron/injections.js +117 -118
- package/lib/electron/ipc/ipc.js +0 -1
- package/lib/electron/main.js +44 -3
- package/lib/electron/tools.js +0 -4
- package/lib/electron/window.js +1 -4
- package/lib/fragments/annotation/index.js +1 -2
- package/lib/fragments/annotation/store.js +47 -48
- package/lib/modules/action-bar/components/apps/app-item/index.js +0 -2
- package/lib/modules/action-bar/components/apps/app-list.js +2 -5
- package/lib/modules/action-bar/components/apps/useAppItemOptions.js +0 -3
- package/lib/modules/action-bar/components/apps/useWidgetList.js +2 -1
- package/lib/modules/action-bar/components/collapse/index.js +0 -4
- package/lib/modules/action-bar/components/item/index.js +0 -2
- package/lib/modules/action-bar/components/leave/index.js +0 -2
- package/lib/modules/action-bar/components/more/poppover-content.js +0 -4
- package/lib/modules/action-bar/components/notification-bar/components/interpreter/index.js +2 -1
- package/lib/modules/action-bar/components/notification-bar/index.js +0 -2
- package/lib/modules/action-bar/components/screen-share/index.js +0 -1
- package/lib/modules/action-bar/components/screen-share/submenu.js +0 -3
- package/lib/modules/action-bar/components/trigger-output-language/index.js +11 -14
- package/lib/modules/action-bar/components/trigger-subscribe-language/index.js +8 -11
- package/lib/modules/action-bar/index.js +1 -2
- package/lib/modules/action-bar/store.js +32 -36
- package/lib/modules/annotation/components/control-bar/index.js +3 -2
- package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.js +2 -1
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.js +2 -1
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.js +0 -2
- package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.js +1 -0
- package/lib/modules/annotation/components/toolbar/store.js +0 -1
- package/lib/modules/annotation/index.d.ts +2 -0
- package/lib/modules/annotation/index.js +2 -1
- package/lib/modules/annotation/store.d.ts +5 -3
- package/lib/modules/annotation/store.js +35 -43
- package/lib/modules/audio-stream/index.js +0 -4
- package/lib/modules/chat/chat-room-store.js +6 -10
- package/lib/modules/chat/components/chat-bar/index.js +0 -2
- package/lib/modules/chat/components/chat-select/index.js +0 -1
- package/lib/modules/chat/components/chat-select/select-item/index.js +2 -5
- package/lib/modules/chat/components/message-list/index.js +1 -3
- package/lib/modules/chat/components/message-list/message-item/index.js +11 -13
- package/lib/modules/chat/index.js +13 -14
- package/lib/modules/chat/store.js +0 -1
- package/lib/modules/chat/view.js +11 -15
- package/lib/modules/components/annotation-menu/index.js +0 -3
- package/lib/modules/components/device-control/components/audio-menu/index.js +2 -1
- package/lib/modules/components/device-control/components/video-menu/index.js +2 -1
- package/lib/modules/components/device-control/store.js +0 -1
- package/lib/modules/components/leave-meeting/components/assign-host.js +4 -5
- package/lib/modules/components/leave-meeting/store.js +11 -12
- package/lib/modules/components/member-window/components/member-actions/components/layout/index.js +1 -2
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +1 -2
- package/lib/modules/components/member-window/components/member-actions/components/user-info.js +1 -3
- package/lib/modules/components/member-window/components/member-actions/index.js +0 -1
- package/lib/modules/components/member-window/components/member-actions/provider.js +1 -2
- package/lib/modules/components/member-window/components/member-actions/store.js +20 -20
- package/lib/modules/components/member-window/components/video-player/components/local-video-player.d.ts +3 -0
- package/lib/modules/components/member-window/components/video-player/components/local-video-player.js +16 -3
- package/lib/modules/components/member-window/components/video-player/index.d.ts +2 -0
- package/lib/modules/components/member-window/components/video-player/index.js +3 -3
- package/lib/modules/components/member-window/index.js +1 -0
- package/lib/modules/components/security-menu/index.js +1 -4
- package/lib/modules/components/tab-frame/index.js +0 -4
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.js +2 -1
- package/lib/modules/connection-gateway/components/phone/index.js +5 -4
- package/lib/modules/connection-gateway/index.js +1 -2
- package/lib/modules/connection-gateway/store.js +23 -26
- package/lib/modules/control-bar/components/more-actions/index.js +0 -3
- package/lib/modules/control-bar/index.js +1 -2
- package/lib/modules/control-bar/store.d.ts +1 -0
- package/lib/modules/control-bar/store.js +8 -2
- package/lib/modules/control-bar/view.js +9 -11
- package/lib/modules/device-pretest/settings/beauty.js +1 -2
- package/lib/modules/device-pretest/settings/virtual-background-setting.js +2 -1
- package/lib/modules/device-pretest/store.js +2 -4
- package/lib/modules/dialog/components/control-bar/index.js +3 -3
- package/lib/modules/dialog/components/dialog-container/component/body.js +0 -2
- package/lib/modules/dialog/components/dialog-container/index.js +1 -2
- package/lib/modules/dialog/components/host-area-container/index.js +0 -3
- package/lib/modules/dialog/components/pre-setting-container/component/body.js +0 -2
- package/lib/modules/dialog/components/pre-setting-container/index.js +1 -2
- package/lib/modules/dialog/components/system-preference/index.js +2 -5
- package/lib/modules/dialog/components/video-window/index.js +0 -2
- package/lib/modules/dialog/hooks/use-popover-watcher.js +0 -1
- package/lib/modules/dialog/hooks/useElectron.js +0 -2
- package/lib/modules/dialog/index.js +1 -3
- package/lib/modules/dialog/store.js +1 -5
- package/lib/modules/dialog/view.js +2 -1
- package/lib/modules/event-confirm/components/window/index.js +0 -2
- package/lib/modules/event-confirm/index.js +1 -2
- package/lib/modules/event-confirm/store.js +4 -7
- package/lib/modules/event-confirm/view.js +2 -1
- package/lib/modules/event-sound/index.js +1 -2
- package/lib/modules/event-sound/sound-effect-player.js +2 -2
- package/lib/modules/event-toast/index.js +1 -2
- package/lib/modules/event-toast/store.js +0 -2
- package/lib/modules/event-toast/view.js +2 -1
- package/lib/modules/interpreter/index.js +1 -2
- package/lib/modules/interpreter/interpreter-list/index.js +3 -4
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-language/index.js +2 -5
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/index.js +0 -2
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +0 -4
- package/lib/modules/interpreter/store.js +5 -10
- package/lib/modules/interpreter/utils.js +15 -14
- package/lib/modules/invite/components/pstn-invite.js +22 -23
- package/lib/modules/invite/components/voip-invite.js +7 -7
- package/lib/modules/invite/enums.js +1 -0
- package/lib/modules/invite/index.js +1 -2
- package/lib/modules/invite/store.js +46 -45
- package/lib/modules/layout/components/CommonVideoRenderer.js +2 -1
- package/lib/modules/layout/components/Gallery.js +5 -3
- package/lib/modules/layout/components/index.js +0 -1
- package/lib/modules/layout/index.js +1 -2
- package/lib/modules/layout/store.d.ts +3 -0
- package/lib/modules/layout/store.js +38 -14
- package/lib/modules/layout/type.js +9 -0
- package/lib/modules/live-streaming/index.dev.js +6 -6
- package/lib/modules/live-streaming/index.js +1 -2
- package/lib/modules/live-streaming/store.js +19 -19
- package/lib/modules/notification/index.js +1 -2
- package/lib/modules/notification/interpreter-status/index.js +2 -1
- package/lib/modules/notification/view.js +1 -2
- package/lib/modules/offscreen-pulling/index.js +0 -1
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.js +1 -4
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.js +0 -2
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.js +0 -2
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.js +1 -4
- package/lib/modules/participant/components/participants/components/participants/index.js +0 -2
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/interpreter-tag/index.js +0 -1
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.js +0 -2
- package/lib/modules/participant/index.js +1 -4
- package/lib/modules/participant/member-list-data-source.js +0 -3
- package/lib/modules/participant/store.js +81 -86
- package/lib/modules/pc-audio-connect/index.js +1 -2
- package/lib/modules/pc-audio-connect/store.js +9 -10
- package/lib/modules/phone-audio-connect/components/callinfo/index.js +2 -1
- package/lib/modules/phone-audio-connect/index.js +1 -2
- package/lib/modules/phone-audio-connect/store.js +0 -3
- package/lib/modules/phone-audio-connect/view.js +5 -4
- package/lib/modules/setting/audio-settings/audio-settings.js +1 -4
- package/lib/modules/setting/general-settings/general-settings.js +1 -2
- package/lib/modules/setting/index.js +1 -2
- package/lib/modules/setting/minutes-settings/minutes-settings.js +1 -2
- package/lib/modules/setting/state/index.js +0 -4
- package/lib/modules/setting/storage-settings/storage-settings.js +4 -4
- package/lib/modules/setting/store.js +11 -15
- package/lib/modules/setting/translate-settings/translate-settings.js +1 -1
- package/lib/modules/setting/video-settings/video-settings.js +1 -2
- package/lib/modules/setting/view.js +1 -2
- package/lib/modules/share-screen/components/selection/index.js +16 -9
- package/lib/modules/share-screen/index.d.ts +2 -0
- package/lib/modules/share-screen/index.js +3 -3
- package/lib/modules/share-screen/store.d.ts +9 -2
- package/lib/modules/share-screen/store.js +97 -93
- package/lib/modules/state-bar/index.js +1 -2
- package/lib/modules/state-bar/layout-config.js +2 -1
- package/lib/modules/state-bar/live-streaming-state.js +0 -3
- package/lib/modules/state-bar/store.js +0 -1
- package/lib/modules/video-window/components/members/index.js +2 -1
- package/lib/modules/video-window/components/topControl/index.js +0 -3
- package/lib/modules/video-window/index.js +1 -2
- package/lib/modules/video-window/store.js +0 -4
- package/lib/modules/waiting-room-layout/index.js +1 -2
- package/lib/modules/whiteboard/components/control-bar/store.js +0 -1
- package/lib/modules/whiteboard/components/switch-theme/index.js +0 -2
- package/lib/modules/whiteboard/components/switch-theme/item.js +2 -1
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +2 -1
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +2 -1
- package/lib/modules/whiteboard/components/toolbar/components/expansion/index.js +1 -4
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +2 -3
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +0 -2
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +1 -2
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +1 -3
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +2 -4
- package/lib/modules/whiteboard/components/toolbar/index.js +1 -1
- package/lib/modules/whiteboard/components/toolbar/store.js +12 -11
- package/lib/modules/whiteboard/index.js +2 -6
- package/lib/modules/whiteboard/style.css +12 -0
- package/lib/modules/whiteboard/view.js +2 -0
- package/lib/modules/widget/index.js +1 -2
- package/lib/modules/widget/web-widget.js +1 -1
- package/lib/plugins/browser-runtime-plugin.js +1 -1
- package/lib/plugins/module-dev-plugin.js +13 -13
- package/lib/providers/ability-provider.d.ts +12 -1
- package/lib/providers/ability-provider.js +8 -1
- package/lib/providers/annotation-provider.js +7 -11
- package/lib/providers/device-privilege-provider.js +81 -83
- package/lib/providers/device-provider.js +193 -198
- package/lib/providers/device-stream-provider.js +24 -27
- package/lib/providers/event-provider.js +0 -2
- package/lib/providers/interpreter-provider.js +195 -197
- package/lib/providers/message-provider.js +0 -2
- package/lib/providers/phone-audio-provider.js +17 -19
- package/lib/providers/privilege-provider.js +53 -58
- package/lib/providers/renderer-provider.d.ts +3 -1
- package/lib/providers/renderer-provider.js +18 -4
- package/lib/providers/room-provider.js +31 -33
- package/lib/providers/screen-share-provider.d.ts +1 -0
- package/lib/providers/screen-share-provider.js +66 -65
- package/lib/providers/sharing-provider.js +2 -1
- package/lib/providers/user-setting-storage-provider.js +0 -2
- package/lib/providers/widget-provider.js +0 -1
- package/lib/scenes/main-scene.js +11 -13
- package/lib/scenes/waiting-scene.js +3 -3
- package/lib/shared-data-source/chat-data.js +0 -2
- package/lib/shared-data-source/interpreter.js +0 -2
- package/lib/shared-data-source/layout-data.js +1 -4
- package/lib/shared-data-source/member-data.js +0 -4
- package/lib/shared-data-source/pin-data.js +0 -1
- package/lib/shared-data-source/screen-share-data.d.ts +2 -2
- package/lib/shared-data-source/screen-share-data.js +1 -2
- package/lib/shared-data-source/security-data.js +0 -1
- package/lib/shared-data-source/setting.js +0 -2
- package/lib/shared-data-source/video-window.js +26 -30
- package/lib/shared-data-source/waiting-room.js +0 -2
- package/lib/type.js +14 -0
- package/lib/ui-scene.js +7 -8
- package/lib/utilities/constant.js +7 -0
- package/lib/utilities/copyText.js +12 -12
- package/lib/utilities/hooks.js +1 -2
- package/lib/utilities/logger.js +0 -1
- package/lib/utilities/parameters.js +2 -2
- package/lib/utilities/privilege.js +0 -3
- package/lib/utilities/renderer-event.js +0 -2
- package/lib/utilities/setting-config-storage.d.ts +2 -0
- package/lib/utilities/setting-config-storage.js +24 -4
- package/lib/utilities/tools.js +6 -10
- package/lib/waiting-room-control-manager.js +26 -28
- package/package.json +5 -5
|
@@ -32,11 +32,6 @@ require("core-js/modules/es.string.includes.js");
|
|
|
32
32
|
require("core-js/modules/es.string.iterator.js");
|
|
33
33
|
require("core-js/modules/es.string.starts-with.js");
|
|
34
34
|
require("core-js/modules/es.string.trim.js");
|
|
35
|
-
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
36
|
-
require("core-js/modules/esnext.async-iterator.find.js");
|
|
37
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
38
|
-
require("core-js/modules/esnext.async-iterator.map.js");
|
|
39
|
-
require("core-js/modules/esnext.async-iterator.reduce.js");
|
|
40
35
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
41
36
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
42
37
|
require("core-js/modules/esnext.iterator.find.js");
|
|
@@ -58,17 +53,20 @@ var _fs2 = _interopRequireDefault(require("fs"));
|
|
|
58
53
|
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
59
54
|
var _jszip = _interopRequireDefault(require("jszip"));
|
|
60
55
|
var _nodeWindowManager = require("node-window-manager");
|
|
56
|
+
var _exitCodes = require("./exit-codes");
|
|
61
57
|
var USER_SETTING_DATA_FILE_NAME = 'UserSettingData.json';
|
|
62
58
|
|
|
63
59
|
// Numeric exit reason enum
|
|
64
60
|
var FcrNumericExitReason = exports.FcrNumericExitReason = /*#__PURE__*/function (FcrNumericExitReason) {
|
|
65
61
|
FcrNumericExitReason[FcrNumericExitReason["LEAVE_ROOM"] = 1] = "LEAVE_ROOM";
|
|
62
|
+
// 自己离开而退出
|
|
66
63
|
FcrNumericExitReason[FcrNumericExitReason["CLOSE_ROOM"] = 2] = "CLOSE_ROOM";
|
|
64
|
+
// 房间关闭而退出
|
|
67
65
|
FcrNumericExitReason[FcrNumericExitReason["KICKED_OUT"] = 3] = "KICKED_OUT";
|
|
68
|
-
|
|
66
|
+
// 被踢出房间而退出
|
|
67
|
+
FcrNumericExitReason[FcrNumericExitReason["ABORTED"] = 4] = "ABORTED"; // 其他原因退出
|
|
69
68
|
return FcrNumericExitReason;
|
|
70
|
-
}({}); //
|
|
71
|
-
// // Mapping from FcrUIExitReason to FcrNumericExitReason
|
|
69
|
+
}({}); // // Mapping from FcrUIExitReason to FcrNumericExitReason
|
|
72
70
|
var exitReasonMap = {
|
|
73
71
|
LEAVE_ROOM: FcrNumericExitReason.LEAVE_ROOM,
|
|
74
72
|
CLOSE_ROOM: FcrNumericExitReason.CLOSE_ROOM,
|
|
@@ -81,18 +79,18 @@ var getBundleType = exports.getBundleType = function getBundleType() {
|
|
|
81
79
|
var openDirectory = exports.openDirectory = /*#__PURE__*/function () {
|
|
82
80
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
83
81
|
var _yield$dialog$showOpe, filePaths;
|
|
84
|
-
return _regenerator["default"].wrap(function
|
|
82
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
85
83
|
while (1) switch (_context.prev = _context.next) {
|
|
86
84
|
case 0:
|
|
87
|
-
_context.next =
|
|
85
|
+
_context.next = 1;
|
|
88
86
|
return _remote.dialog.showOpenDialog((0, _remote.getCurrentWindow)(), {
|
|
89
87
|
properties: ['openDirectory']
|
|
90
88
|
});
|
|
91
|
-
case
|
|
89
|
+
case 1:
|
|
92
90
|
_yield$dialog$showOpe = _context.sent;
|
|
93
91
|
filePaths = _yield$dialog$showOpe.filePaths;
|
|
94
92
|
return _context.abrupt("return", filePaths[0]);
|
|
95
|
-
case
|
|
93
|
+
case 2:
|
|
96
94
|
case "end":
|
|
97
95
|
return _context.stop();
|
|
98
96
|
}
|
|
@@ -124,7 +122,7 @@ var setFragmentOptions = exports.setFragmentOptions = function setFragmentOption
|
|
|
124
122
|
};
|
|
125
123
|
var getLaunchOptions = exports.getLaunchOptions = /*#__PURE__*/function () {
|
|
126
124
|
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
127
|
-
return _regenerator["default"].wrap(function
|
|
125
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
128
126
|
while (1) switch (_context2.prev = _context2.next) {
|
|
129
127
|
case 0:
|
|
130
128
|
return _context2.abrupt("return", _electron.ipcRenderer.invoke('get-launch-options'));
|
|
@@ -176,12 +174,12 @@ var rendererWindowMutationObservers = {};
|
|
|
176
174
|
var openRendererWindow = exports.openRendererWindow = /*#__PURE__*/function () {
|
|
177
175
|
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(frameName, renderFn, windowOptions) {
|
|
178
176
|
var rendererWindow, windowConstructorOptionsString, newRendererWindow, windowId, _browserWindow, renderDom, parentWindow, parentHead, parentStyles, parentStyleLinks, stylesLoadedPromises, oldenObserver, observer, parentRoot, parentRootStyles, _windowId, _browserWindow2, _newRendererWindow, _renderDom;
|
|
179
|
-
return _regenerator["default"].wrap(function
|
|
177
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
180
178
|
while (1) switch (_context3.prev = _context3.next) {
|
|
181
179
|
case 0:
|
|
182
180
|
rendererWindow = rendererWindows[frameName];
|
|
183
181
|
if (rendererWindow) {
|
|
184
|
-
_context3.next =
|
|
182
|
+
_context3.next = 5;
|
|
185
183
|
break;
|
|
186
184
|
}
|
|
187
185
|
windowConstructorOptionsString = Object.entries(windowOptions).reduce(function (acc, _ref4) {
|
|
@@ -194,33 +192,33 @@ var openRendererWindow = exports.openRendererWindow = /*#__PURE__*/function () {
|
|
|
194
192
|
return "".concat(acc, ",").concat(key, "=").concat(JSON.stringify(value));
|
|
195
193
|
}, '');
|
|
196
194
|
newRendererWindow = window.open('', frameName, windowConstructorOptionsString);
|
|
197
|
-
_context3.next =
|
|
195
|
+
_context3.next = 1;
|
|
198
196
|
return _electron.ipcRenderer.invoke('getBrowserWindowId', frameName);
|
|
199
|
-
case
|
|
197
|
+
case 1:
|
|
200
198
|
windowId = _context3.sent;
|
|
201
199
|
if (windowId) {
|
|
202
|
-
_context3.next =
|
|
200
|
+
_context3.next = 2;
|
|
203
201
|
break;
|
|
204
202
|
}
|
|
205
203
|
console.error('windowId not found');
|
|
206
204
|
return _context3.abrupt("return");
|
|
207
|
-
case
|
|
205
|
+
case 2:
|
|
208
206
|
_browserWindow = _remote.BrowserWindow.getAllWindows().find(function (win) {
|
|
209
207
|
return win.id === windowId;
|
|
210
208
|
});
|
|
211
209
|
_browserWindow === null || _browserWindow === void 0 || _browserWindow.webContents.setBackgroundThrottling(false);
|
|
212
210
|
if (!newRendererWindow) {
|
|
213
|
-
_context3.next =
|
|
211
|
+
_context3.next = 4;
|
|
214
212
|
break;
|
|
215
213
|
}
|
|
216
214
|
newRendererWindow.document.write('<div id="root"></div>');
|
|
217
215
|
renderDom = newRendererWindow.document.getElementById('root');
|
|
218
216
|
if (renderDom) {
|
|
219
|
-
_context3.next =
|
|
217
|
+
_context3.next = 3;
|
|
220
218
|
break;
|
|
221
219
|
}
|
|
222
220
|
return _context3.abrupt("return");
|
|
223
|
-
case
|
|
221
|
+
case 3:
|
|
224
222
|
// copy styles from parent window
|
|
225
223
|
parentWindow = window;
|
|
226
224
|
parentHead = parentWindow.document.head;
|
|
@@ -273,37 +271,37 @@ var openRendererWindow = exports.openRendererWindow = /*#__PURE__*/function () {
|
|
|
273
271
|
Promise.allSettled(stylesLoadedPromises)["finally"](function () {
|
|
274
272
|
renderFn(renderDom, _browserWindow, newRendererWindow);
|
|
275
273
|
});
|
|
276
|
-
case
|
|
277
|
-
_context3.next =
|
|
274
|
+
case 4:
|
|
275
|
+
_context3.next = 9;
|
|
278
276
|
break;
|
|
279
|
-
case
|
|
280
|
-
_context3.next =
|
|
277
|
+
case 5:
|
|
278
|
+
_context3.next = 6;
|
|
281
279
|
return _electron.ipcRenderer.invoke('getBrowserWindowId', frameName);
|
|
282
|
-
case
|
|
280
|
+
case 6:
|
|
283
281
|
_windowId = _context3.sent;
|
|
284
282
|
if (_windowId) {
|
|
285
|
-
_context3.next =
|
|
283
|
+
_context3.next = 7;
|
|
286
284
|
break;
|
|
287
285
|
}
|
|
288
286
|
console.error('windowId not found');
|
|
289
287
|
return _context3.abrupt("return");
|
|
290
|
-
case
|
|
288
|
+
case 7:
|
|
291
289
|
_browserWindow2 = _remote.BrowserWindow.getAllWindows().find(function (win) {
|
|
292
290
|
return win.id === _windowId;
|
|
293
291
|
});
|
|
294
292
|
_newRendererWindow = rendererWindows[frameName];
|
|
295
293
|
_renderDom = _newRendererWindow.document.getElementById('root');
|
|
296
294
|
if (_renderDom) {
|
|
297
|
-
_context3.next =
|
|
295
|
+
_context3.next = 8;
|
|
298
296
|
break;
|
|
299
297
|
}
|
|
300
298
|
return _context3.abrupt("return");
|
|
301
|
-
case
|
|
299
|
+
case 8:
|
|
302
300
|
renderFn(_renderDom, _browserWindow2, _newRendererWindow);
|
|
303
301
|
_browserWindow2 === null || _browserWindow2 === void 0 || _browserWindow2.show();
|
|
304
302
|
_browserWindow2 === null || _browserWindow2 === void 0 || _browserWindow2.focus();
|
|
305
303
|
_browserWindow2 === null || _browserWindow2 === void 0 || _browserWindow2.moveTop();
|
|
306
|
-
case
|
|
304
|
+
case 9:
|
|
307
305
|
case "end":
|
|
308
306
|
return _context3.stop();
|
|
309
307
|
}
|
|
@@ -316,15 +314,15 @@ var openRendererWindow = exports.openRendererWindow = /*#__PURE__*/function () {
|
|
|
316
314
|
var checkMediaPermission = exports.checkMediaPermission = /*#__PURE__*/function () {
|
|
317
315
|
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(mediaType) {
|
|
318
316
|
var res;
|
|
319
|
-
return _regenerator["default"].wrap(function
|
|
317
|
+
return _regenerator["default"].wrap(function (_context4) {
|
|
320
318
|
while (1) switch (_context4.prev = _context4.next) {
|
|
321
319
|
case 0:
|
|
322
|
-
_context4.next =
|
|
320
|
+
_context4.next = 1;
|
|
323
321
|
return _electron.ipcRenderer.invoke('checkMediaPermission', mediaType);
|
|
324
|
-
case
|
|
322
|
+
case 1:
|
|
325
323
|
res = _context4.sent;
|
|
326
324
|
return _context4.abrupt("return", res);
|
|
327
|
-
case
|
|
325
|
+
case 2:
|
|
328
326
|
case "end":
|
|
329
327
|
return _context4.stop();
|
|
330
328
|
}
|
|
@@ -340,12 +338,12 @@ var openSystemPreferences = exports.openSystemPreferences = function openSystemP
|
|
|
340
338
|
var closeRendererWindow = exports.closeRendererWindow = /*#__PURE__*/function () {
|
|
341
339
|
var _ref7 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(frameName) {
|
|
342
340
|
var windowId, _browserWindow3;
|
|
343
|
-
return _regenerator["default"].wrap(function
|
|
341
|
+
return _regenerator["default"].wrap(function (_context5) {
|
|
344
342
|
while (1) switch (_context5.prev = _context5.next) {
|
|
345
343
|
case 0:
|
|
346
|
-
_context5.next =
|
|
344
|
+
_context5.next = 1;
|
|
347
345
|
return _electron.ipcRenderer.invoke('getBrowserWindowId', frameName);
|
|
348
|
-
case
|
|
346
|
+
case 1:
|
|
349
347
|
windowId = _context5.sent;
|
|
350
348
|
if (windowId) {
|
|
351
349
|
_browserWindow3 = _remote.BrowserWindow.getAllWindows().find(function (win) {
|
|
@@ -355,7 +353,7 @@ var closeRendererWindow = exports.closeRendererWindow = /*#__PURE__*/function ()
|
|
|
355
353
|
_browserWindow3.emit('will-close');
|
|
356
354
|
}
|
|
357
355
|
}
|
|
358
|
-
case
|
|
356
|
+
case 2:
|
|
359
357
|
case "end":
|
|
360
358
|
return _context5.stop();
|
|
361
359
|
}
|
|
@@ -368,15 +366,15 @@ var closeRendererWindow = exports.closeRendererWindow = /*#__PURE__*/function ()
|
|
|
368
366
|
var launch = exports.launch = /*#__PURE__*/function () {
|
|
369
367
|
var _ref8 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(options) {
|
|
370
368
|
var res;
|
|
371
|
-
return _regenerator["default"].wrap(function
|
|
369
|
+
return _regenerator["default"].wrap(function (_context6) {
|
|
372
370
|
while (1) switch (_context6.prev = _context6.next) {
|
|
373
371
|
case 0:
|
|
374
|
-
_context6.next =
|
|
372
|
+
_context6.next = 1;
|
|
375
373
|
return _electron.ipcRenderer.invoke('launch', options);
|
|
376
|
-
case
|
|
374
|
+
case 1:
|
|
377
375
|
res = _context6.sent;
|
|
378
376
|
return _context6.abrupt("return", res);
|
|
379
|
-
case
|
|
377
|
+
case 2:
|
|
380
378
|
case "end":
|
|
381
379
|
return _context6.stop();
|
|
382
380
|
}
|
|
@@ -387,7 +385,7 @@ var launch = exports.launch = /*#__PURE__*/function () {
|
|
|
387
385
|
};
|
|
388
386
|
}();
|
|
389
387
|
var quitApp = exports.quitApp = function quitApp() {
|
|
390
|
-
_remote.app.exit(
|
|
388
|
+
_remote.app.exit(_exitCodes.AppExitCode.NORMAL_EXIT);
|
|
391
389
|
};
|
|
392
390
|
var getSystemMemorySize = exports.getSystemMemorySize = function getSystemMemorySize() {
|
|
393
391
|
return _os["default"].totalmem();
|
|
@@ -496,6 +494,7 @@ var imageExtensions = ['.png', '.jpg'];
|
|
|
496
494
|
var videoExtensions = ['.mp4'];
|
|
497
495
|
var audioExtensions = ['.mp3', '.wav'];
|
|
498
496
|
var zipExtensions = ['.zip'];
|
|
497
|
+
console.log("Preload script loaded, process id: ".concat(process.pid));
|
|
499
498
|
console.log("Is dev mode: ".concat(isDevMode));
|
|
500
499
|
console.log("App path: ".concat(appPath));
|
|
501
500
|
console.log("App data path: ".concat(appDataPath));
|
|
@@ -515,16 +514,16 @@ var getResourcePath = function getResourcePath(type, md5Url) {
|
|
|
515
514
|
var unZipAndSaveFile = /*#__PURE__*/function () {
|
|
516
515
|
var _ref9 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(zipFile, outputPath, type) {
|
|
517
516
|
var zipBuffer, zip, fileNames;
|
|
518
|
-
return _regenerator["default"].wrap(function
|
|
517
|
+
return _regenerator["default"].wrap(function (_context8) {
|
|
519
518
|
while (1) switch (_context8.prev = _context8.next) {
|
|
520
519
|
case 0:
|
|
521
520
|
zipBuffer = _fs2["default"].readFileSync(zipFile);
|
|
522
|
-
_context8.next =
|
|
521
|
+
_context8.next = 1;
|
|
523
522
|
return _jszip["default"].loadAsync(zipBuffer);
|
|
524
|
-
case
|
|
523
|
+
case 1:
|
|
525
524
|
zip = _context8.sent;
|
|
526
525
|
fileNames = [];
|
|
527
|
-
_context8.next =
|
|
526
|
+
_context8.next = 2;
|
|
528
527
|
return Promise.all(Object.keys(zip.files).filter(function (filename) {
|
|
529
528
|
// 忽略目录、扩展文件或不需要的文件
|
|
530
529
|
var isDirectory = zip.files[filename].dir;
|
|
@@ -535,14 +534,14 @@ var unZipAndSaveFile = /*#__PURE__*/function () {
|
|
|
535
534
|
var isUserDataFile = type === 'image' ? imageExtensions.includes(_path2["default"].extname(filename)) : type === 'video' ? videoExtensions.includes(_path2["default"].extname(filename)) : audioExtensions.includes(_path2["default"].extname(filename));
|
|
536
535
|
return !isDirectory && !isExtensionFile && isUserDataFile;
|
|
537
536
|
}).map(/*#__PURE__*/function () {
|
|
538
|
-
var
|
|
537
|
+
var _ref0 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(filenameTmp) {
|
|
539
538
|
var fileData, realFileName, outputFile;
|
|
540
|
-
return _regenerator["default"].wrap(function
|
|
539
|
+
return _regenerator["default"].wrap(function (_context7) {
|
|
541
540
|
while (1) switch (_context7.prev = _context7.next) {
|
|
542
541
|
case 0:
|
|
543
|
-
_context7.next =
|
|
542
|
+
_context7.next = 1;
|
|
544
543
|
return zip.files[filenameTmp].async('nodebuffer');
|
|
545
|
-
case
|
|
544
|
+
case 1:
|
|
546
545
|
fileData = _context7.sent;
|
|
547
546
|
realFileName = _path2["default"].basename(filenameTmp);
|
|
548
547
|
outputFile = _path2["default"].resolve(outputPath, realFileName);
|
|
@@ -551,21 +550,21 @@ var unZipAndSaveFile = /*#__PURE__*/function () {
|
|
|
551
550
|
});
|
|
552
551
|
_fs2["default"].writeFileSync(outputFile, fileData);
|
|
553
552
|
fileNames.push(outputFile);
|
|
554
|
-
case
|
|
553
|
+
case 2:
|
|
555
554
|
case "end":
|
|
556
555
|
return _context7.stop();
|
|
557
556
|
}
|
|
558
557
|
}, _callee7);
|
|
559
558
|
}));
|
|
560
|
-
return function (
|
|
561
|
-
return
|
|
559
|
+
return function (_x0) {
|
|
560
|
+
return _ref0.apply(this, arguments);
|
|
562
561
|
};
|
|
563
562
|
}()));
|
|
564
|
-
case
|
|
563
|
+
case 2:
|
|
565
564
|
// 删除 zip 文件
|
|
566
565
|
_fs2["default"].unlinkSync(zipFile);
|
|
567
566
|
return _context8.abrupt("return", fileNames);
|
|
568
|
-
case
|
|
567
|
+
case 3:
|
|
569
568
|
case "end":
|
|
570
569
|
return _context8.stop();
|
|
571
570
|
}
|
|
@@ -611,15 +610,15 @@ function getSpecificFiles(directory, extensions, fileName) {
|
|
|
611
610
|
return [];
|
|
612
611
|
}
|
|
613
612
|
}
|
|
614
|
-
function downloadFile(
|
|
613
|
+
function downloadFile(_x1, _x10) {
|
|
615
614
|
return _downloadFile.apply(this, arguments);
|
|
616
615
|
} // 获取资源
|
|
617
616
|
function _downloadFile() {
|
|
618
|
-
_downloadFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
619
|
-
return _regenerator["default"].wrap(function
|
|
620
|
-
while (1) switch (
|
|
617
|
+
_downloadFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(url, destination) {
|
|
618
|
+
return _regenerator["default"].wrap(function (_context12) {
|
|
619
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
621
620
|
case 0:
|
|
622
|
-
return
|
|
621
|
+
return _context12.abrupt("return", new Promise(function (resolve, reject) {
|
|
623
622
|
var request = _remote.net.request(url);
|
|
624
623
|
request.on('response', function (response) {
|
|
625
624
|
var fileStream = _fs2["default"].createWriteStream(destination);
|
|
@@ -643,16 +642,16 @@ function _downloadFile() {
|
|
|
643
642
|
}));
|
|
644
643
|
case 1:
|
|
645
644
|
case "end":
|
|
646
|
-
return
|
|
645
|
+
return _context12.stop();
|
|
647
646
|
}
|
|
648
|
-
},
|
|
647
|
+
}, _callee12);
|
|
649
648
|
}));
|
|
650
649
|
return _downloadFile.apply(this, arguments);
|
|
651
650
|
}
|
|
652
651
|
var getResourceByFileType = exports.getResourceByFileType = /*#__PURE__*/function () {
|
|
653
|
-
var
|
|
652
|
+
var _ref1 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(url, md5Url, type) {
|
|
654
653
|
var resourcePath, extensionMap, extensions, cachedFiles, zipFileName, zipCacheDir, zipFiles, tempZipPath, zipPath, zipFilePath, filePathList;
|
|
655
|
-
return _regenerator["default"].wrap(function
|
|
654
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
656
655
|
while (1) switch (_context9.prev = _context9.next) {
|
|
657
656
|
case 0:
|
|
658
657
|
resourcePath = getResourcePath(type, md5Url);
|
|
@@ -664,55 +663,55 @@ var getResourceByFileType = exports.getResourceByFileType = /*#__PURE__*/functio
|
|
|
664
663
|
extensions = extensionMap[type]; // 已有背景文件,直接使用
|
|
665
664
|
cachedFiles = getSpecificFiles(resourcePath, extensions);
|
|
666
665
|
if (!(cachedFiles.length > 0)) {
|
|
667
|
-
_context9.next =
|
|
666
|
+
_context9.next = 1;
|
|
668
667
|
break;
|
|
669
668
|
}
|
|
670
669
|
console.log("Using cached files for ".concat(url, ": ").concat(JSON.stringify(cachedFiles)));
|
|
671
670
|
return _context9.abrupt("return", cachedFiles);
|
|
672
|
-
case
|
|
671
|
+
case 1:
|
|
673
672
|
// 已有 zip
|
|
674
673
|
zipFileName = "".concat(md5Url, ".zip");
|
|
675
674
|
zipCacheDir = getZipCachePath(type);
|
|
676
675
|
zipFiles = getSpecificFiles(zipCacheDir, zipExtensions, zipFileName); // 没有 zip,需要下载
|
|
677
676
|
if (!(zipFiles.length <= 0)) {
|
|
678
|
-
_context9.next =
|
|
677
|
+
_context9.next = 3;
|
|
679
678
|
break;
|
|
680
679
|
}
|
|
681
680
|
tempZipPath = _path2["default"].resolve("".concat(zipCacheDir, "/").concat(md5Url, ".temp"));
|
|
682
681
|
zipPath = _path2["default"].resolve("".concat(zipCacheDir, "/").concat(zipFileName));
|
|
683
682
|
console.log("start downloading zip file from ".concat(url, " to ").concat(tempZipPath));
|
|
684
|
-
_context9.next =
|
|
683
|
+
_context9.next = 2;
|
|
685
684
|
return downloadFile(url, tempZipPath);
|
|
686
|
-
case
|
|
685
|
+
case 2:
|
|
687
686
|
console.log("finished downloading zip file to ".concat(tempZipPath));
|
|
688
687
|
|
|
689
688
|
// temp 文件重命名为 zip
|
|
690
689
|
_fs2["default"].renameSync(tempZipPath, zipPath);
|
|
691
690
|
console.log("renamed temp file from ".concat(tempZipPath, " to ").concat(zipPath));
|
|
692
691
|
zipFiles = getSpecificFiles(zipCacheDir, zipExtensions, zipFileName);
|
|
693
|
-
case
|
|
692
|
+
case 3:
|
|
694
693
|
if (!(!zipFiles || zipFiles.length <= 0)) {
|
|
695
|
-
_context9.next =
|
|
694
|
+
_context9.next = 4;
|
|
696
695
|
break;
|
|
697
696
|
}
|
|
698
697
|
console.warn("No zip files found for ".concat(url));
|
|
699
698
|
return _context9.abrupt("return", []);
|
|
700
|
-
case
|
|
699
|
+
case 4:
|
|
701
700
|
zipFilePath = zipFiles[0]; // 解压并返回背景文件
|
|
702
|
-
_context9.next =
|
|
701
|
+
_context9.next = 5;
|
|
703
702
|
return unZipAndSaveFile(zipFilePath, resourcePath, type);
|
|
704
|
-
case
|
|
703
|
+
case 5:
|
|
705
704
|
filePathList = _context9.sent;
|
|
706
705
|
console.log("Unzipped files from ".concat(zipFilePath, ": ").concat(JSON.stringify(filePathList)));
|
|
707
706
|
return _context9.abrupt("return", filePathList);
|
|
708
|
-
case
|
|
707
|
+
case 6:
|
|
709
708
|
case "end":
|
|
710
709
|
return _context9.stop();
|
|
711
710
|
}
|
|
712
711
|
}, _callee9);
|
|
713
712
|
}));
|
|
714
|
-
return function getResourceByFileType(
|
|
715
|
-
return
|
|
713
|
+
return function getResourceByFileType(_x11, _x12, _x13) {
|
|
714
|
+
return _ref1.apply(this, arguments);
|
|
716
715
|
};
|
|
717
716
|
}();
|
|
718
717
|
|
|
@@ -738,24 +737,24 @@ var fileToBlob = exports.fileToBlob = function fileToBlob(file, type) {
|
|
|
738
737
|
});
|
|
739
738
|
};
|
|
740
739
|
var loadBuiltinResources = exports.loadBuiltinResources = /*#__PURE__*/function () {
|
|
741
|
-
var
|
|
740
|
+
var _ref10 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee1() {
|
|
742
741
|
var buildtinVirtualBackgroundImagePath, buildtinVirtualBackgroundVideoPath, buildtinSoundEffectsPath;
|
|
743
|
-
return _regenerator["default"].wrap(function
|
|
744
|
-
while (1) switch (
|
|
742
|
+
return _regenerator["default"].wrap(function (_context1) {
|
|
743
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
745
744
|
case 0:
|
|
746
745
|
buildtinVirtualBackgroundImagePath = _path2["default"].join(buildtinResourcesPath, 'images');
|
|
747
746
|
buildtinVirtualBackgroundVideoPath = _path2["default"].join(buildtinResourcesPath, 'videos');
|
|
748
747
|
buildtinSoundEffectsPath = _path2["default"].join(buildtinResourcesPath, 'sound_effects');
|
|
749
|
-
return
|
|
750
|
-
var
|
|
748
|
+
return _context1.abrupt("return", new Promise(/*#__PURE__*/function () {
|
|
749
|
+
var _ref11 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0(resolve) {
|
|
751
750
|
var _yield$Promise$allSet, _yield$Promise$allSet2, images, videos, sounds, virtualBackgroundImages, virtualBackgroundVideos, soundEffects;
|
|
752
|
-
return _regenerator["default"].wrap(function
|
|
753
|
-
while (1) switch (
|
|
751
|
+
return _regenerator["default"].wrap(function (_context0) {
|
|
752
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
754
753
|
case 0:
|
|
755
|
-
|
|
754
|
+
_context0.next = 1;
|
|
756
755
|
return Promise.allSettled([_promises["default"].readdir(buildtinVirtualBackgroundImagePath), _promises["default"].readdir(buildtinVirtualBackgroundVideoPath), _promises["default"].readdir(buildtinSoundEffectsPath)]);
|
|
757
|
-
case
|
|
758
|
-
_yield$Promise$allSet =
|
|
756
|
+
case 1:
|
|
757
|
+
_yield$Promise$allSet = _context0.sent;
|
|
759
758
|
_yield$Promise$allSet2 = (0, _slicedToArray2["default"])(_yield$Promise$allSet, 3);
|
|
760
759
|
images = _yield$Promise$allSet2[0];
|
|
761
760
|
videos = _yield$Promise$allSet2[1];
|
|
@@ -792,24 +791,24 @@ var loadBuiltinResources = exports.loadBuiltinResources = /*#__PURE__*/function
|
|
|
792
791
|
virtualBackgroundVideos: virtualBackgroundVideos,
|
|
793
792
|
soundEffects: soundEffects
|
|
794
793
|
});
|
|
795
|
-
case
|
|
794
|
+
case 2:
|
|
796
795
|
case "end":
|
|
797
|
-
return
|
|
796
|
+
return _context0.stop();
|
|
798
797
|
}
|
|
799
|
-
},
|
|
798
|
+
}, _callee0);
|
|
800
799
|
}));
|
|
801
|
-
return function (
|
|
802
|
-
return
|
|
800
|
+
return function (_x14) {
|
|
801
|
+
return _ref11.apply(this, arguments);
|
|
803
802
|
};
|
|
804
803
|
}()));
|
|
805
|
-
case
|
|
804
|
+
case 1:
|
|
806
805
|
case "end":
|
|
807
|
-
return
|
|
806
|
+
return _context1.stop();
|
|
808
807
|
}
|
|
809
|
-
},
|
|
808
|
+
}, _callee1);
|
|
810
809
|
}));
|
|
811
810
|
return function loadBuiltinResources() {
|
|
812
|
-
return
|
|
811
|
+
return _ref10.apply(this, arguments);
|
|
813
812
|
};
|
|
814
813
|
}();
|
|
815
814
|
var releaseSubAllWindowRefs = exports.releaseSubAllWindowRefs = function releaseSubAllWindowRefs() {
|
|
@@ -828,7 +827,7 @@ var setInMeetingState = exports.setInMeetingState = function setInMeetingState(s
|
|
|
828
827
|
};
|
|
829
828
|
var restartApp = exports.restartApp = function restartApp() {
|
|
830
829
|
_remote.app.relaunch();
|
|
831
|
-
_remote.app.exit(
|
|
830
|
+
_remote.app.exit(_exitCodes.AppExitCode.NORMAL_EXIT);
|
|
832
831
|
};
|
|
833
832
|
var getUserSettingData = exports.getUserSettingData = function getUserSettingData() {
|
|
834
833
|
try {
|
|
@@ -850,22 +849,22 @@ var openSetting = exports.openSetting = function openSetting() {
|
|
|
850
849
|
_electron.ipcRenderer.invoke('openSetting');
|
|
851
850
|
};
|
|
852
851
|
var getIsSDKReady = exports.getIsSDKReady = /*#__PURE__*/function () {
|
|
853
|
-
var
|
|
854
|
-
return _regenerator["default"].wrap(function
|
|
855
|
-
while (1) switch (
|
|
852
|
+
var _ref12 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
853
|
+
return _regenerator["default"].wrap(function (_context10) {
|
|
854
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
856
855
|
case 0:
|
|
857
|
-
|
|
856
|
+
_context10.next = 1;
|
|
858
857
|
return _electron.ipcRenderer.invoke('getIsSDKReady');
|
|
858
|
+
case 1:
|
|
859
|
+
return _context10.abrupt("return", _context10.sent);
|
|
859
860
|
case 2:
|
|
860
|
-
return _context12.abrupt("return", _context12.sent);
|
|
861
|
-
case 3:
|
|
862
861
|
case "end":
|
|
863
|
-
return
|
|
862
|
+
return _context10.stop();
|
|
864
863
|
}
|
|
865
|
-
},
|
|
864
|
+
}, _callee10);
|
|
866
865
|
}));
|
|
867
866
|
return function getIsSDKReady() {
|
|
868
|
-
return
|
|
867
|
+
return _ref12.apply(this, arguments);
|
|
869
868
|
};
|
|
870
869
|
}();
|
|
871
870
|
var launchSuccess = exports.launchSuccess = function launchSuccess(roomId) {
|
|
@@ -882,21 +881,21 @@ var exitedMeeting = exports.exitedMeeting = function exitedMeeting(roomId, reaso
|
|
|
882
881
|
_electron.ipcRenderer.send('exited-meeting', roomId, numericReason);
|
|
883
882
|
};
|
|
884
883
|
var getIsMeetingLaunched = exports.getIsMeetingLaunched = /*#__PURE__*/function () {
|
|
885
|
-
var
|
|
886
|
-
return _regenerator["default"].wrap(function
|
|
887
|
-
while (1) switch (
|
|
884
|
+
var _ref13 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
885
|
+
return _regenerator["default"].wrap(function (_context11) {
|
|
886
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
888
887
|
case 0:
|
|
889
|
-
|
|
888
|
+
_context11.next = 1;
|
|
890
889
|
return _electron.ipcRenderer.invoke('getIsMeetingLaunched');
|
|
890
|
+
case 1:
|
|
891
|
+
return _context11.abrupt("return", _context11.sent);
|
|
891
892
|
case 2:
|
|
892
|
-
return _context13.abrupt("return", _context13.sent);
|
|
893
|
-
case 3:
|
|
894
893
|
case "end":
|
|
895
|
-
return
|
|
894
|
+
return _context11.stop();
|
|
896
895
|
}
|
|
897
|
-
},
|
|
896
|
+
}, _callee11);
|
|
898
897
|
}));
|
|
899
898
|
return function getIsMeetingLaunched() {
|
|
900
|
-
return
|
|
899
|
+
return _ref13.apply(this, arguments);
|
|
901
900
|
};
|
|
902
901
|
}();
|
package/lib/electron/ipc/ipc.js
CHANGED
|
@@ -16,7 +16,6 @@ require("core-js/modules/es.json.stringify.js");
|
|
|
16
16
|
require("core-js/modules/es.object.keys.js");
|
|
17
17
|
require("core-js/modules/es.object.to-string.js");
|
|
18
18
|
require("core-js/modules/es.regexp.to-string.js");
|
|
19
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
20
19
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
21
20
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
22
21
|
require("core-js/modules/esnext.json.parse.js");
|
package/lib/electron/main.js
CHANGED
|
@@ -9,14 +9,16 @@ require("core-js/modules/es.array.concat.js");
|
|
|
9
9
|
require("core-js/modules/es.array.includes.js");
|
|
10
10
|
require("core-js/modules/es.string.starts-with.js");
|
|
11
11
|
require("core-js/modules/web.timers.js");
|
|
12
|
+
var _electron = require("electron");
|
|
12
13
|
var _window = require("./window");
|
|
13
14
|
var _screenshot = require("./plugins/screenshot");
|
|
14
15
|
var _logger = require("./logger");
|
|
15
16
|
var _meetingState = require("./plugins/meeting-state");
|
|
17
|
+
var _exitCodes = require("./exit-codes");
|
|
16
18
|
var logger = (0, _logger.getLogger)();
|
|
17
19
|
var hookWindow = exports.hookWindow = function hookWindow(mainWindow) {
|
|
18
20
|
mainWindow.webContents.addListener('did-create-window', function (window, details) {
|
|
19
|
-
logger.info("[electron][window]: browser window is opened, frameName: ".concat(details.frameName));
|
|
21
|
+
logger.info("[electron][window]: browser window is opened, frameName: ".concat(details.frameName, ", windowId: ").concat(window.id));
|
|
20
22
|
var builtinFrameNames = ['device-settings', 'chat', 'live-streaming', 'participant', 'share-screen-selection', 'invite', 'video-window', 'confirm', 'connection-gateway', 'whiteboard', 'progress-dialog', 'operation-waiting-room', 'operation-waiting-room', 'interpreter-setting', 'waiting-room-single-remove', 'waiting-room-all-remove', 'waiting-room-all-admit', 'control-bar', 'show-toast', 'system-preference', 'rename', 'annotation-tool', 'leave-meeting'];
|
|
21
23
|
if (!builtinFrameNames.includes(details.frameName) && !details.frameName.startsWith('widget')) {
|
|
22
24
|
logger.info("[electron][window]: frameName [".concat(details.frameName, "] is not in builtinFrameNames, ignore it"));
|
|
@@ -28,6 +30,27 @@ var hookWindow = exports.hookWindow = function hookWindow(mainWindow) {
|
|
|
28
30
|
(0, _window.deleteRendererWindow)(details.frameName);
|
|
29
31
|
});
|
|
30
32
|
|
|
33
|
+
// 监听渲染进程崩溃事件
|
|
34
|
+
window.webContents.addListener('render-process-gone', function (event, details) {
|
|
35
|
+
// 安全地获取 window 信息,避免在崩溃状态下访问可能失效的属性
|
|
36
|
+
var windowTitle = 'Unknown';
|
|
37
|
+
var windowId = 'Unknown';
|
|
38
|
+
try {
|
|
39
|
+
// 检查 window 是否仍然有效
|
|
40
|
+
if (!window.isDestroyed()) {
|
|
41
|
+
windowTitle = window.getTitle() || 'Unknown';
|
|
42
|
+
windowId = String(window.id);
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
logger.warn("[electron][window]: failed to get window info during crash: ".concat(error));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 输出详细的崩溃信息
|
|
49
|
+
logger.error("[electron][window]: window crash details - title: ".concat(windowTitle, ", id: ").concat(windowId, ", exitCode: ").concat(details.exitCode, ", reason: ").concat(details.reason));
|
|
50
|
+
logger.error('[electron][window]: exiting process due to render-process-gone event');
|
|
51
|
+
_electron.app.exit(_exitCodes.AppExitCode.RENDERER_PROCESS_GONE);
|
|
52
|
+
});
|
|
53
|
+
|
|
31
54
|
// prevent the close event to keep the window alive and renderer process will take charge of when to close the window
|
|
32
55
|
// renderer process will receive the will-close event, do some clean up and then call window.close() to close the window
|
|
33
56
|
window.addListener('close', function (event) {
|
|
@@ -58,12 +81,30 @@ var hookWindow = exports.hookWindow = function hookWindow(mainWindow) {
|
|
|
58
81
|
attachEventOnMethod(window, 'show', 'CALL_SHOW');
|
|
59
82
|
});
|
|
60
83
|
mainWindow.webContents.addListener('render-process-gone', function (event, details) {
|
|
61
|
-
|
|
84
|
+
// 安全地获取主窗口信息,避免在崩溃状态下访问可能失效的属性
|
|
85
|
+
var mainWindowTitle = 'Main Window';
|
|
86
|
+
var mainWindowId = 'Unknown';
|
|
87
|
+
try {
|
|
88
|
+
// 检查主窗口是否仍然有效
|
|
89
|
+
if (!mainWindow.isDestroyed()) {
|
|
90
|
+
mainWindowTitle = mainWindow.getTitle() || 'Main Window';
|
|
91
|
+
mainWindowId = String(mainWindow.id);
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
logger.warn("[electron][window]: failed to get main window info during crash: ".concat(error));
|
|
95
|
+
}
|
|
96
|
+
logger.info("[electron][window]: main browser window render-process-gone, window [".concat(mainWindowTitle, ":").concat(mainWindowId, "], details.exitCode: ").concat(details.exitCode, ", details.reason: ").concat(details.reason));
|
|
62
97
|
(0, _window.closeAllWindows)();
|
|
63
98
|
(0, _window.clearAllRendererWindows)();
|
|
64
99
|
setTimeout(function () {
|
|
65
100
|
logger.info('[electron][window]: start reloading main window...');
|
|
66
|
-
|
|
101
|
+
try {
|
|
102
|
+
if (!mainWindow.isDestroyed()) {
|
|
103
|
+
mainWindow.reload();
|
|
104
|
+
}
|
|
105
|
+
} catch (error) {
|
|
106
|
+
logger.error("[electron][window]: failed to reload main window: ".concat(error));
|
|
107
|
+
}
|
|
67
108
|
}, 1000);
|
|
68
109
|
});
|
|
69
110
|
mainWindow.on('enter-full-screen', function () {
|