fcr-ui-scene 3.9.0-alpha → 3.9.1-alpha
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/creator/provider-initializer.browser.js +4 -2
- package/lib/creator/provider-initializer.electron.js +13 -5
- package/lib/electron/injections.d.ts +1 -0
- package/lib/electron/injections.js +4 -1
- package/lib/electron/preload.js +1 -0
- package/lib/fragments/annotation/style.css +1 -0
- package/lib/fragments/whiteboard/style.css +4 -0
- package/lib/modules/action-bar/main-scene/store.base.d.ts +1 -0
- package/lib/modules/action-bar/main-scene/store.base.js +5 -0
- package/lib/modules/audio-stream/index.d.ts +2 -0
- package/lib/modules/audio-stream/index.js +33 -1
- package/lib/modules/chat/chat-room-store.js +4 -2
- package/lib/modules/chat/index.js +1 -1
- package/lib/modules/chat/store.d.ts +1 -1
- package/lib/modules/chat/store.js +4 -2
- package/lib/modules/components/device-control/store.base.d.ts +1 -0
- package/lib/modules/components/device-control/store.base.js +22 -3
- package/lib/modules/components/leave-meeting/index.js +3 -2
- package/lib/modules/components/leave-meeting/main-scene/store.d.ts +1 -0
- package/lib/modules/components/leave-meeting/main-scene/store.js +6 -1
- package/lib/modules/components/leave-meeting/store.base.d.ts +1 -0
- package/lib/modules/components/leave-meeting/store.base.js +1 -1
- package/lib/modules/components/leave-meeting/waiting-scene/store.d.ts +1 -0
- package/lib/modules/components/leave-meeting/waiting-scene/store.js +6 -1
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +7 -10
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +2 -2
- package/lib/modules/components/member-window/components/member-actions/index.js +0 -7
- package/lib/modules/components/member-window/components/member-actions/store.js +1 -1
- package/lib/modules/components/member-window/index.js +1 -1
- package/lib/modules/components/tab-frame/index.css +12 -1
- package/lib/modules/components/tab-frame/index.js +4 -1
- package/lib/modules/control-bar/components/share-state-nav/index.js +1 -3
- package/lib/modules/control-bar/mouse-event-bridge.d.ts +23 -0
- package/lib/modules/control-bar/mouse-event-bridge.js +87 -0
- package/lib/modules/control-bar/store.d.ts +3 -2
- package/lib/modules/control-bar/store.js +17 -29
- package/lib/modules/control-bar/type.d.ts +0 -1
- package/lib/modules/control-bar/view.js +21 -17
- package/lib/modules/dialog/dialogs/connection-gateway/tabs.js +3 -2
- package/lib/modules/dialog/dialogs/invite/index.js +6 -24
- package/lib/modules/invite/components/copy-info.css +72 -0
- package/lib/modules/invite/components/copy-info.d.ts +3 -0
- package/lib/modules/invite/components/copy-info.js +144 -0
- package/lib/modules/invite/components/pstn-invite.js +3 -15
- package/lib/modules/invite/components/voip-invite.js +10 -1
- package/lib/modules/invite/enums.d.ts +3 -1
- package/lib/modules/invite/enums.js +2 -0
- package/lib/modules/invite/store.d.ts +4 -1
- package/lib/modules/invite/store.js +37 -13
- package/lib/modules/invite/view.js +41 -20
- package/lib/modules/layout/store.base.d.ts +2 -1
- package/lib/modules/layout/store.base.js +20 -23
- package/lib/modules/participant/components/confirm-input/index.css +67 -1
- package/lib/modules/participant/components/confirm-input/index.js +16 -13
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.css +4 -0
- package/lib/modules/participant/store.base.d.ts +1 -0
- package/lib/modules/participant/store.base.js +34 -7
- package/lib/modules/pc-audio-connect/main-scene/store.d.ts +2 -0
- package/lib/modules/pc-audio-connect/main-scene/store.js +12 -2
- package/lib/modules/pc-audio-connect/view.js +4 -2
- package/lib/modules/phone-audio-connect/store.d.ts +6 -4
- package/lib/modules/phone-audio-connect/store.js +12 -1
- package/lib/modules/phone-audio-connect/view.js +6 -4
- package/lib/modules/secondary-window/index.js +2 -2
- package/lib/modules/secondary-window/store.d.ts +3 -0
- package/lib/modules/secondary-window/store.js +16 -1
- package/lib/modules/secondary-window/view.js +96 -72
- package/lib/modules/toast-manager/type.d.ts +2 -1
- package/lib/modules/toast-manager/type.js +4 -1
- package/lib/plugins/module-dev-plugin.js +4 -4
- package/lib/providers/ability-provider.d.ts +15 -0
- package/lib/providers/ability-provider.js +13 -1
- package/lib/providers/mouse-detect/provider.d.ts +2 -0
- package/lib/providers/mouse-detect/provider.empty.d.ts +14 -0
- package/lib/providers/mouse-detect/provider.empty.js +47 -0
- package/lib/providers/mouse-detect/provider.js +13 -4
- package/lib/providers/mouse-detect/type.d.ts +2 -0
- package/lib/providers/phone-audio-provider.d.ts +31 -5
- package/lib/providers/phone-audio-provider.js +83 -22
- package/lib/providers/user-audio-volume-provider.d.ts +6 -0
- package/lib/providers/user-audio-volume-provider.js +3 -2
- package/lib/runtime.d.ts +1 -0
- package/lib/scenes/main-scene.js +2 -1
- package/lib/shared-data/chat-data.d.ts +19 -0
- package/lib/shared-data/chat-data.js +54 -7
- package/lib/shared-data/member-data.d.ts +9 -1
- package/lib/shared-data/member-data.js +46 -17
- package/lib/shared-data/video-window.js +8 -4
- package/lib/translations/enUS.d.ts +245 -1
- package/lib/translations/enUS.js +247 -3
- package/lib/translations/zhCN.d.ts +245 -1
- package/lib/translations/zhCN.js +246 -2
- package/lib/utilities/os.d.ts +1 -0
- package/lib/utilities/os.js +15 -0
- package/lib/utilities/renderer.d.ts +1 -0
- package/lib/utilities/renderer.js +7 -1
- package/lib-es/creator/provider-initializer.browser.js +4 -2
- package/lib-es/creator/provider-initializer.electron.js +11 -3
- package/lib-es/electron/injections.js +3 -0
- package/lib-es/electron/preload.js +2 -1
- package/lib-es/fragments/annotation/style.css +1 -0
- package/lib-es/fragments/whiteboard/style.css +4 -0
- package/lib-es/modules/action-bar/main-scene/store.base.js +5 -0
- package/lib-es/modules/audio-stream/index.js +33 -1
- package/lib-es/modules/chat/chat-room-store.js +4 -2
- package/lib-es/modules/chat/index.js +1 -1
- package/lib-es/modules/chat/store.js +4 -2
- package/lib-es/modules/components/device-control/store.base.js +22 -3
- package/lib-es/modules/components/leave-meeting/index.js +3 -2
- package/lib-es/modules/components/leave-meeting/main-scene/store.js +6 -1
- package/lib-es/modules/components/leave-meeting/store.base.js +1 -1
- package/lib-es/modules/components/leave-meeting/waiting-scene/store.js +6 -1
- package/lib-es/modules/components/member-window/components/member-actions/components/icon-status.js +7 -10
- package/lib-es/modules/components/member-window/components/member-actions/components/more-actions.js +2 -2
- package/lib-es/modules/components/member-window/components/member-actions/index.js +0 -7
- package/lib-es/modules/components/member-window/components/member-actions/store.js +1 -1
- package/lib-es/modules/components/member-window/index.js +1 -1
- package/lib-es/modules/components/tab-frame/index.css +12 -1
- package/lib-es/modules/components/tab-frame/index.js +4 -1
- package/lib-es/modules/control-bar/components/share-state-nav/index.js +1 -3
- package/lib-es/modules/control-bar/mouse-event-bridge.js +79 -0
- package/lib-es/modules/control-bar/store.js +18 -30
- package/lib-es/modules/control-bar/view.js +21 -17
- package/lib-es/modules/dialog/dialogs/connection-gateway/tabs.js +3 -2
- package/lib-es/modules/dialog/dialogs/invite/index.js +6 -24
- package/lib-es/modules/invite/components/copy-info.css +72 -0
- package/lib-es/modules/invite/components/copy-info.js +137 -0
- package/lib-es/modules/invite/components/pstn-invite.js +3 -15
- package/lib-es/modules/invite/components/voip-invite.js +10 -1
- package/lib-es/modules/invite/enums.js +2 -0
- package/lib-es/modules/invite/store.js +38 -14
- package/lib-es/modules/invite/view.js +43 -22
- package/lib-es/modules/layout/store.base.js +20 -23
- package/lib-es/modules/participant/components/confirm-input/index.css +67 -1
- package/lib-es/modules/participant/components/confirm-input/index.js +16 -13
- package/lib-es/modules/participant/components/participants/components/render-user/components/attendee/index.css +4 -0
- package/lib-es/modules/participant/store.base.js +34 -7
- package/lib-es/modules/pc-audio-connect/main-scene/store.js +12 -2
- package/lib-es/modules/pc-audio-connect/view.js +4 -2
- package/lib-es/modules/phone-audio-connect/store.js +12 -1
- package/lib-es/modules/phone-audio-connect/view.js +6 -4
- package/lib-es/modules/secondary-window/index.js +2 -2
- package/lib-es/modules/secondary-window/store.js +16 -1
- package/lib-es/modules/secondary-window/view.js +97 -73
- package/lib-es/modules/toast-manager/type.js +4 -1
- package/lib-es/plugins/module-dev-plugin.js +4 -4
- package/lib-es/providers/ability-provider.js +13 -1
- package/lib-es/providers/mouse-detect/provider.empty.js +39 -0
- package/lib-es/providers/mouse-detect/provider.js +13 -4
- package/lib-es/providers/phone-audio-provider.js +109 -48
- package/lib-es/providers/user-audio-volume-provider.js +3 -2
- package/lib-es/scenes/main-scene.js +3 -2
- package/lib-es/shared-data/chat-data.js +55 -8
- package/lib-es/shared-data/member-data.js +46 -17
- package/lib-es/shared-data/video-window.js +8 -4
- package/lib-es/translations/enUS.js +247 -3
- package/lib-es/translations/zhCN.js +246 -2
- package/lib-es/utilities/os.js +8 -0
- package/lib-es/utilities/renderer.js +7 -1
- package/lib-es/utilities/shared-storage.js +2 -2
- package/package.json +6 -6
- package/lib/modules/connection-gateway/components/computer/index.css +0 -12
- package/lib/modules/connection-gateway/components/computer/index.d.ts +0 -3
- package/lib/modules/connection-gateway/components/computer/index.js +0 -66
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.css +0 -36
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.d.ts +0 -10
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.js +0 -78
- package/lib/modules/connection-gateway/components/phone/components/calling/index.css +0 -72
- package/lib/modules/connection-gateway/components/phone/components/calling/index.d.ts +0 -7
- package/lib/modules/connection-gateway/components/phone/components/calling/index.js +0 -58
- package/lib/modules/connection-gateway/components/phone/components/remeber/index.css +0 -10
- package/lib/modules/connection-gateway/components/phone/components/remeber/index.d.ts +0 -5
- package/lib/modules/connection-gateway/components/phone/components/remeber/index.js +0 -24
- package/lib/modules/connection-gateway/components/phone/components/useing/index.css +0 -46
- package/lib/modules/connection-gateway/components/phone/components/useing/index.d.ts +0 -3
- package/lib/modules/connection-gateway/components/phone/components/useing/index.js +0 -36
- package/lib/modules/connection-gateway/components/phone/index.css +0 -49
- package/lib/modules/connection-gateway/components/phone/index.d.ts +0 -3
- package/lib/modules/connection-gateway/components/phone/index.js +0 -185
- package/lib/modules/connection-gateway/enums.d.ts +0 -4
- package/lib/modules/connection-gateway/enums.js +0 -12
- package/lib/modules/connection-gateway/index.css +0 -6
- package/lib/modules/connection-gateway/index.d.ts +0 -10
- package/lib/modules/connection-gateway/index.js +0 -78
- package/lib/modules/connection-gateway/store.d.ts +0 -68
- package/lib/modules/connection-gateway/store.js +0 -713
- package/lib/modules/connection-gateway/types.d.ts +0 -8
- package/lib/modules/connection-gateway/types.js +0 -6
- package/lib/modules/connection-gateway/view.d.ts +0 -1
- package/lib/modules/connection-gateway/view.js +0 -39
- package/lib-es/modules/connection-gateway/components/computer/index.css +0 -12
- package/lib-es/modules/connection-gateway/components/computer/index.js +0 -59
- package/lib-es/modules/connection-gateway/components/phone/components/callinfo/index.css +0 -36
- package/lib-es/modules/connection-gateway/components/phone/components/callinfo/index.js +0 -71
- package/lib-es/modules/connection-gateway/components/phone/components/calling/index.css +0 -72
- package/lib-es/modules/connection-gateway/components/phone/components/calling/index.js +0 -51
- package/lib-es/modules/connection-gateway/components/phone/components/remeber/index.css +0 -10
- package/lib-es/modules/connection-gateway/components/phone/components/remeber/index.js +0 -17
- package/lib-es/modules/connection-gateway/components/phone/components/useing/index.css +0 -46
- package/lib-es/modules/connection-gateway/components/phone/components/useing/index.js +0 -29
- package/lib-es/modules/connection-gateway/components/phone/index.css +0 -49
- package/lib-es/modules/connection-gateway/components/phone/index.js +0 -177
- package/lib-es/modules/connection-gateway/enums.js +0 -5
- package/lib-es/modules/connection-gateway/index.css +0 -6
- package/lib-es/modules/connection-gateway/index.js +0 -60
- package/lib-es/modules/connection-gateway/store.js +0 -707
- package/lib-es/modules/connection-gateway/types.js +0 -1
- package/lib-es/modules/connection-gateway/view.js +0 -31
|
@@ -1,713 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.symbol.description.js");
|
|
5
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
6
|
-
require("core-js/modules/es.symbol.to-primitive.js");
|
|
7
|
-
require("core-js/modules/es.error.cause.js");
|
|
8
|
-
require("core-js/modules/es.error.to-string.js");
|
|
9
|
-
require("core-js/modules/es.array.from.js");
|
|
10
|
-
require("core-js/modules/es.array.is-array.js");
|
|
11
|
-
require("core-js/modules/es.array.push.js");
|
|
12
|
-
require("core-js/modules/es.array.slice.js");
|
|
13
|
-
require("core-js/modules/es.date.to-primitive.js");
|
|
14
|
-
require("core-js/modules/es.date.to-string.js");
|
|
15
|
-
require("core-js/modules/es.function.name.js");
|
|
16
|
-
require("core-js/modules/es.map.js");
|
|
17
|
-
require("core-js/modules/es.object.create.js");
|
|
18
|
-
require("core-js/modules/es.object.define-property.js");
|
|
19
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
20
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
21
|
-
require("core-js/modules/es.regexp.test.js");
|
|
22
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
23
|
-
require("core-js/modules/esnext.function.metadata.js");
|
|
24
|
-
require("core-js/modules/esnext.map.delete-all.js");
|
|
25
|
-
require("core-js/modules/esnext.map.emplace.js");
|
|
26
|
-
require("core-js/modules/esnext.map.every.js");
|
|
27
|
-
require("core-js/modules/esnext.map.filter.js");
|
|
28
|
-
require("core-js/modules/esnext.map.find.js");
|
|
29
|
-
require("core-js/modules/esnext.map.find-key.js");
|
|
30
|
-
require("core-js/modules/esnext.map.includes.js");
|
|
31
|
-
require("core-js/modules/esnext.map.key-of.js");
|
|
32
|
-
require("core-js/modules/esnext.map.map-keys.js");
|
|
33
|
-
require("core-js/modules/esnext.map.map-values.js");
|
|
34
|
-
require("core-js/modules/esnext.map.merge.js");
|
|
35
|
-
require("core-js/modules/esnext.map.reduce.js");
|
|
36
|
-
require("core-js/modules/esnext.map.some.js");
|
|
37
|
-
require("core-js/modules/esnext.map.update.js");
|
|
38
|
-
require("core-js/modules/esnext.symbol.metadata.js");
|
|
39
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
40
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
41
|
-
Object.defineProperty(exports, "__esModule", {
|
|
42
|
-
value: true
|
|
43
|
-
});
|
|
44
|
-
exports["default"] = exports.StoreContext = void 0;
|
|
45
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
46
|
-
require("core-js/modules/es.array.filter.js");
|
|
47
|
-
require("core-js/modules/es.array.find.js");
|
|
48
|
-
require("core-js/modules/es.array.find-index.js");
|
|
49
|
-
require("core-js/modules/es.array.for-each.js");
|
|
50
|
-
require("core-js/modules/es.array.iterator.js");
|
|
51
|
-
require("core-js/modules/es.array.some.js");
|
|
52
|
-
require("core-js/modules/es.array.unshift.js");
|
|
53
|
-
require("core-js/modules/es.date.to-json.js");
|
|
54
|
-
require("core-js/modules/es.function.bind.js");
|
|
55
|
-
require("core-js/modules/es.json.stringify.js");
|
|
56
|
-
require("core-js/modules/es.number.constructor.js");
|
|
57
|
-
require("core-js/modules/es.object.keys.js");
|
|
58
|
-
require("core-js/modules/es.object.to-string.js");
|
|
59
|
-
require("core-js/modules/es.string.iterator.js");
|
|
60
|
-
require("core-js/modules/es.weak-map.js");
|
|
61
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
62
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
63
|
-
require("core-js/modules/esnext.iterator.find.js");
|
|
64
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
65
|
-
require("core-js/modules/esnext.iterator.some.js");
|
|
66
|
-
require("core-js/modules/esnext.json.parse.js");
|
|
67
|
-
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
68
|
-
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
69
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
70
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
71
|
-
require("core-js/modules/web.timers.js");
|
|
72
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
73
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
74
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
75
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
76
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
77
|
-
var _fcrCore = require("fcr-core");
|
|
78
|
-
var _mobx = require("mobx");
|
|
79
|
-
var _react = require("react");
|
|
80
|
-
var _decorator = require("agora-foundation/lib/decorator");
|
|
81
|
-
var _type = require("fcr-core/lib/room-control/room-connector-control/type");
|
|
82
|
-
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
83
|
-
var _tools = require("agora-foundation/lib/utilities/tools");
|
|
84
|
-
var _type2 = require("../../type");
|
|
85
|
-
var _constant = require("../../utilities/constant");
|
|
86
|
-
var _enums = require("./enums");
|
|
87
|
-
var _objectManager = require("../../object-manager");
|
|
88
|
-
var _type3 = require("../setting/type");
|
|
89
|
-
var _type4 = require("../../modules/toast-manager/type");
|
|
90
|
-
var _ConnectionGatewayStore;
|
|
91
|
-
var _initProto, _init_activeTabKey, _init_rememberMe, _init_rememberedNumberList, _init_connectionPhoneInfo, _init_currentRegion, _init_currentCallInfo, _init_connectInfo, _init_phoneCallState, _init_phoneCallReason, _init_connectSession, _init_calling, _init_outgoingCall, _init_isHangup, _init_hasPstnStream, _init_hasNeedMergedStream, _onTabChangeDecs, _onGetConnectInfoDecs, _regionChangeHandlerDecs, _startCallDecs, _stopCallDecs, _setRememberMeDecs, _initRememberedDataDecs, _rememberNumberDecs, _phoneCallUpdatedDecs, _phoneCallReasonDecs, _setStreamStateDecs, _handleStreamsAddedOrUpdatedDecs, _handleStreamsRemovedDecs, _ref;
|
|
92
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
93
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
94
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
95
|
-
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
96
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
97
|
-
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
98
|
-
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
99
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
100
|
-
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
101
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
102
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
103
|
-
function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
104
|
-
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
|
|
105
|
-
var _A = /*#__PURE__*/new WeakMap();
|
|
106
|
-
var _B = /*#__PURE__*/new WeakMap();
|
|
107
|
-
var _C = /*#__PURE__*/new WeakMap();
|
|
108
|
-
var _D = /*#__PURE__*/new WeakMap();
|
|
109
|
-
var _E = /*#__PURE__*/new WeakMap();
|
|
110
|
-
var _F = /*#__PURE__*/new WeakMap();
|
|
111
|
-
var _G = /*#__PURE__*/new WeakMap();
|
|
112
|
-
var _H = /*#__PURE__*/new WeakMap();
|
|
113
|
-
var _I = /*#__PURE__*/new WeakMap();
|
|
114
|
-
var _J = /*#__PURE__*/new WeakMap();
|
|
115
|
-
var _K = /*#__PURE__*/new WeakMap();
|
|
116
|
-
var _L = /*#__PURE__*/new WeakMap();
|
|
117
|
-
var _M = /*#__PURE__*/new WeakMap();
|
|
118
|
-
var _N = /*#__PURE__*/new WeakMap();
|
|
119
|
-
var _O = /*#__PURE__*/new WeakMap();
|
|
120
|
-
_ref = (_onTabChangeDecs = [_mobx.action, _mobx.action.bound], _onGetConnectInfoDecs = [_mobx.action, _mobx.action.bound], _regionChangeHandlerDecs = [_mobx.action, _mobx.action.bound], _startCallDecs = [_mobx.action, _mobx.action.bound], _stopCallDecs = [_mobx.action, _mobx.action.bound], _setRememberMeDecs = [_mobx.action, _mobx.action.bound], _initRememberedDataDecs = [_mobx.action, _mobx.action.bound], _rememberNumberDecs = [_mobx.action, _mobx.action.bound], _phoneCallUpdatedDecs = [_mobx.action, _mobx.action.bound], _phoneCallReasonDecs = [_mobx.action, _mobx.action.bound], _setStreamStateDecs = [_mobx.action, _mobx.action.bound], _handleStreamsAddedOrUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleStreamsRemovedDecs = [_mobx.action, _mobx.action.bound], "_roomControl");
|
|
121
|
-
var ConnectionGatewayStore = exports["default"] = /*#__PURE__*/function () {
|
|
122
|
-
function ConnectionGatewayStore(_ref2) {
|
|
123
|
-
var _this = this;
|
|
124
|
-
var objectManager = _ref2.objectManager;
|
|
125
|
-
(0, _classCallCheck2["default"])(this, ConnectionGatewayStore);
|
|
126
|
-
(0, _defineProperty2["default"])(this, _ref, void _initProto(this));
|
|
127
|
-
(0, _defineProperty2["default"])(this, "_disposers", []);
|
|
128
|
-
(0, _defineProperty2["default"])(this, "_roomOberver", {
|
|
129
|
-
onPhoneConnectorSessionStateUpdated: this._phoneCallUpdated.bind(this)
|
|
130
|
-
});
|
|
131
|
-
(0, _defineProperty2["default"])(this, "_streamObserver", {
|
|
132
|
-
onStreamsAdded: this._handleStreamsAddedOrUpdated,
|
|
133
|
-
onStreamsUpdated: this._handleStreamsAddedOrUpdated,
|
|
134
|
-
onStreamsRemoved: this._handleStreamsRemoved
|
|
135
|
-
});
|
|
136
|
-
(0, _defineProperty2["default"])(this, "_failureTimer", null);
|
|
137
|
-
(0, _defineProperty2["default"])(this, "_accepted", false);
|
|
138
|
-
(0, _defineProperty2["default"])(this, "_sessionId", '');
|
|
139
|
-
_classPrivateFieldInitSpec(this, _A, _init_activeTabKey(this, 'computer'));
|
|
140
|
-
_classPrivateFieldInitSpec(this, _B, _init_rememberMe(this, true));
|
|
141
|
-
_classPrivateFieldInitSpec(this, _C, _init_rememberedNumberList(this, []));
|
|
142
|
-
_classPrivateFieldInitSpec(this, _D, _init_connectionPhoneInfo(this, []));
|
|
143
|
-
_classPrivateFieldInitSpec(this, _E, _init_currentRegion(this, _enums.ConnectorRegion.CHINA));
|
|
144
|
-
_classPrivateFieldInitSpec(this, _F, _init_currentCallInfo(this, {
|
|
145
|
-
zone: '+86',
|
|
146
|
-
phone: ''
|
|
147
|
-
}));
|
|
148
|
-
_classPrivateFieldInitSpec(this, _G, _init_connectInfo(this, {}));
|
|
149
|
-
_classPrivateFieldInitSpec(this, _H, _init_phoneCallState(this, _type.FcrRoomConnectorSessionState.CALLING));
|
|
150
|
-
_classPrivateFieldInitSpec(this, _I, _init_phoneCallReason(this, _type.FcrRoomConnectorSessionReason.NONE));
|
|
151
|
-
_classPrivateFieldInitSpec(this, _J, _init_connectSession(this, null));
|
|
152
|
-
_classPrivateFieldInitSpec(this, _K, _init_calling(this, false));
|
|
153
|
-
_classPrivateFieldInitSpec(this, _L, _init_outgoingCall(this, false));
|
|
154
|
-
_classPrivateFieldInitSpec(this, _M, _init_isHangup(this, false));
|
|
155
|
-
_classPrivateFieldInitSpec(this, _N, _init_hasPstnStream(this, false));
|
|
156
|
-
_classPrivateFieldInitSpec(this, _O, _init_hasNeedMergedStream(this, false));
|
|
157
|
-
// Get all required objects from objectManager
|
|
158
|
-
this._eventProvider = objectManager.getObject(_objectManager.FcrUIObjectKeys.P_EVENT_PROVIDER);
|
|
159
|
-
this._messageProvider = objectManager.getObject(_objectManager.FcrUIObjectKeys.P_MESSAGE_PROVIDER);
|
|
160
|
-
this._dialogProvider = objectManager.getObject(_objectManager.FcrUIObjectKeys.P_DIALOG_PROVIDER);
|
|
161
|
-
this._deviceProvider = objectManager.getObject(_objectManager.FcrUIObjectKeys.P_DEVICE_PROVIDER);
|
|
162
|
-
this._sharedMemberDataSource = objectManager.getObject(_objectManager.FcrUIObjectKeys.S_SHARED_MEMBER_DATA_SOURCE);
|
|
163
|
-
var roomProvider = objectManager.getObject(_objectManager.FcrUIObjectKeys.P_ROOM_PROVIDER);
|
|
164
|
-
this._roomControl = roomProvider.currentRoomControl;
|
|
165
|
-
this._streamControl = this._roomControl.getStreamControl();
|
|
166
|
-
|
|
167
|
-
// Optional providers with try-catch
|
|
168
|
-
this._devicePrivilegeProvider = objectManager.getObject(_objectManager.FcrUIObjectKeys.P_DEVICE_PRIVILEGE_PROVIDER);
|
|
169
|
-
this._sharedDevicePrivilegeDataSource = objectManager.getObject(_objectManager.FcrUIObjectKeys.S_SHARED_DEVICE_PRIVILEGE_DATA_SOURCE);
|
|
170
|
-
this._sharedSettingDataSource = objectManager.getObject(_objectManager.FcrUIObjectKeys.S_SHARED_SETTING_DATA_SOURCE);
|
|
171
|
-
this._deviceObserver = {
|
|
172
|
-
onAudioConnected: function onAudioConnected() {
|
|
173
|
-
_this.closeConnectionDialog();
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
this._roomControl.getRoomConnectorControl().addObserver(this._roomOberver);
|
|
177
|
-
this._streamControl.addObserver(this._streamObserver);
|
|
178
|
-
this.initRememberedData();
|
|
179
|
-
this.onGetConnectInfo();
|
|
180
|
-
}
|
|
181
|
-
return (0, _createClass2["default"])(ConnectionGatewayStore, [{
|
|
182
|
-
key: "activeTabKey",
|
|
183
|
-
get: function get() {
|
|
184
|
-
return _classPrivateFieldGet(_A, this);
|
|
185
|
-
},
|
|
186
|
-
set: function set(v) {
|
|
187
|
-
_classPrivateFieldSet(_A, this, v);
|
|
188
|
-
}
|
|
189
|
-
}, {
|
|
190
|
-
key: "rememberMe",
|
|
191
|
-
get: function get() {
|
|
192
|
-
return _classPrivateFieldGet(_B, this);
|
|
193
|
-
},
|
|
194
|
-
set: function set(v) {
|
|
195
|
-
_classPrivateFieldSet(_B, this, v);
|
|
196
|
-
}
|
|
197
|
-
}, {
|
|
198
|
-
key: "rememberedNumberList",
|
|
199
|
-
get: function get() {
|
|
200
|
-
return _classPrivateFieldGet(_C, this);
|
|
201
|
-
},
|
|
202
|
-
set: function set(v) {
|
|
203
|
-
_classPrivateFieldSet(_C, this, v);
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
key: "connectionPhoneInfo",
|
|
207
|
-
get: function get() {
|
|
208
|
-
return _classPrivateFieldGet(_D, this);
|
|
209
|
-
},
|
|
210
|
-
set: function set(v) {
|
|
211
|
-
_classPrivateFieldSet(_D, this, v);
|
|
212
|
-
}
|
|
213
|
-
}, {
|
|
214
|
-
key: "currentRegion",
|
|
215
|
-
get: function get() {
|
|
216
|
-
return _classPrivateFieldGet(_E, this);
|
|
217
|
-
},
|
|
218
|
-
set: function set(v) {
|
|
219
|
-
_classPrivateFieldSet(_E, this, v);
|
|
220
|
-
}
|
|
221
|
-
}, {
|
|
222
|
-
key: "currentCallInfo",
|
|
223
|
-
get: function get() {
|
|
224
|
-
return _classPrivateFieldGet(_F, this);
|
|
225
|
-
},
|
|
226
|
-
set: function set(v) {
|
|
227
|
-
_classPrivateFieldSet(_F, this, v);
|
|
228
|
-
}
|
|
229
|
-
}, {
|
|
230
|
-
key: "connectInfo",
|
|
231
|
-
get: function get() {
|
|
232
|
-
return _classPrivateFieldGet(_G, this);
|
|
233
|
-
},
|
|
234
|
-
set: function set(v) {
|
|
235
|
-
_classPrivateFieldSet(_G, this, v);
|
|
236
|
-
}
|
|
237
|
-
}, {
|
|
238
|
-
key: "phoneCallState",
|
|
239
|
-
get: function get() {
|
|
240
|
-
return _classPrivateFieldGet(_H, this);
|
|
241
|
-
},
|
|
242
|
-
set: function set(v) {
|
|
243
|
-
_classPrivateFieldSet(_H, this, v);
|
|
244
|
-
}
|
|
245
|
-
}, {
|
|
246
|
-
key: "phoneCallReason",
|
|
247
|
-
get: function get() {
|
|
248
|
-
return _classPrivateFieldGet(_I, this);
|
|
249
|
-
},
|
|
250
|
-
set: function set(v) {
|
|
251
|
-
_classPrivateFieldSet(_I, this, v);
|
|
252
|
-
}
|
|
253
|
-
}, {
|
|
254
|
-
key: "connectSession",
|
|
255
|
-
get: function get() {
|
|
256
|
-
return _classPrivateFieldGet(_J, this);
|
|
257
|
-
},
|
|
258
|
-
set: function set(v) {
|
|
259
|
-
_classPrivateFieldSet(_J, this, v);
|
|
260
|
-
}
|
|
261
|
-
}, {
|
|
262
|
-
key: "calling",
|
|
263
|
-
get: function get() {
|
|
264
|
-
return _classPrivateFieldGet(_K, this);
|
|
265
|
-
},
|
|
266
|
-
set: function set(v) {
|
|
267
|
-
_classPrivateFieldSet(_K, this, v);
|
|
268
|
-
}
|
|
269
|
-
}, {
|
|
270
|
-
key: "outgoingCall",
|
|
271
|
-
get: function get() {
|
|
272
|
-
return _classPrivateFieldGet(_L, this);
|
|
273
|
-
},
|
|
274
|
-
set: function set(v) {
|
|
275
|
-
_classPrivateFieldSet(_L, this, v);
|
|
276
|
-
}
|
|
277
|
-
}, {
|
|
278
|
-
key: "isHangup",
|
|
279
|
-
get: function get() {
|
|
280
|
-
return _classPrivateFieldGet(_M, this);
|
|
281
|
-
},
|
|
282
|
-
set: function set(v) {
|
|
283
|
-
_classPrivateFieldSet(_M, this, v);
|
|
284
|
-
}
|
|
285
|
-
}, {
|
|
286
|
-
key: "hasPstnStream",
|
|
287
|
-
get: function get() {
|
|
288
|
-
return _classPrivateFieldGet(_N, this);
|
|
289
|
-
},
|
|
290
|
-
set: function set(v) {
|
|
291
|
-
_classPrivateFieldSet(_N, this, v);
|
|
292
|
-
}
|
|
293
|
-
}, {
|
|
294
|
-
key: "hasNeedMergedStream",
|
|
295
|
-
get: function get() {
|
|
296
|
-
return _classPrivateFieldGet(_O, this);
|
|
297
|
-
},
|
|
298
|
-
set: function set(v) {
|
|
299
|
-
_classPrivateFieldSet(_O, this, v);
|
|
300
|
-
}
|
|
301
|
-
}, {
|
|
302
|
-
key: "connectType",
|
|
303
|
-
get: function get() {
|
|
304
|
-
return this._deviceProvider.connectType;
|
|
305
|
-
}
|
|
306
|
-
}, {
|
|
307
|
-
key: "localUser",
|
|
308
|
-
get: function get() {
|
|
309
|
-
return this._sharedMemberDataSource.localUser;
|
|
310
|
-
}
|
|
311
|
-
}, {
|
|
312
|
-
key: "hasOwnPstnStream",
|
|
313
|
-
get: function get() {
|
|
314
|
-
return this._sharedMemberDataSource.hasOwnPstnStream;
|
|
315
|
-
}
|
|
316
|
-
}, {
|
|
317
|
-
key: "openAudioSettings",
|
|
318
|
-
value: function openAudioSettings() {
|
|
319
|
-
this._dialogProvider.openDialog(_constant.FcrUIDialogKey.SETTINGS, {
|
|
320
|
-
activeTab: _type3.DeviceSettingTab.AUDIO,
|
|
321
|
-
highlightSelector: _constant.FcrUIHighlightElement.AUDIO_MICROPHONE
|
|
322
|
-
});
|
|
323
|
-
this._sharedSettingDataSource.setDialogConfig({
|
|
324
|
-
activeTab: _type3.DeviceSettingTab.AUDIO,
|
|
325
|
-
highlightSelector: _constant.FcrUIHighlightElement.AUDIO_MICROPHONE
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
}, {
|
|
329
|
-
key: "closeConnectionDialog",
|
|
330
|
-
value: function closeConnectionDialog() {
|
|
331
|
-
this._dialogProvider.closeDialog(_constant.FcrUIDialogKey.CONNECTION_GATEWAY);
|
|
332
|
-
}
|
|
333
|
-
}, {
|
|
334
|
-
key: "onTabChange",
|
|
335
|
-
value: function onTabChange(key) {
|
|
336
|
-
this.activeTabKey = key;
|
|
337
|
-
if (key === 'phone' && this.connectionPhoneInfo.length === 0) {
|
|
338
|
-
this.onGetConnectInfo();
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}, {
|
|
342
|
-
key: "onGetConnectInfo",
|
|
343
|
-
value: function () {
|
|
344
|
-
var _onGetConnectInfo = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
345
|
-
return _regenerator["default"].wrap(function (_context) {
|
|
346
|
-
while (1) switch (_context.prev = _context.next) {
|
|
347
|
-
case 0:
|
|
348
|
-
_context.next = 1;
|
|
349
|
-
return this._roomControl.getRoomConnectorControl().getRoomConnectorPhoneInfo();
|
|
350
|
-
case 1:
|
|
351
|
-
this.connectionPhoneInfo = _context.sent;
|
|
352
|
-
this.connectInfo = this.connectionPhoneInfo[0];
|
|
353
|
-
case 2:
|
|
354
|
-
case "end":
|
|
355
|
-
return _context.stop();
|
|
356
|
-
}
|
|
357
|
-
}, _callee, this);
|
|
358
|
-
}));
|
|
359
|
-
function onGetConnectInfo() {
|
|
360
|
-
return _onGetConnectInfo.apply(this, arguments);
|
|
361
|
-
}
|
|
362
|
-
return onGetConnectInfo;
|
|
363
|
-
}()
|
|
364
|
-
}, {
|
|
365
|
-
key: "regionChangeHandler",
|
|
366
|
-
value: function regionChangeHandler(region) {
|
|
367
|
-
this.currentRegion = region;
|
|
368
|
-
this.setConnectionInfo(region);
|
|
369
|
-
}
|
|
370
|
-
}, {
|
|
371
|
-
key: "setConnectionInfo",
|
|
372
|
-
value: function setConnectionInfo() {
|
|
373
|
-
var region = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _enums.ConnectorRegion.CHINA;
|
|
374
|
-
if (this.connectionPhoneInfo.length > 0) {
|
|
375
|
-
this.connectInfo = this.connectionPhoneInfo.find(function (info) {
|
|
376
|
-
return info.region === Number(region);
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}, {
|
|
381
|
-
key: "setCurrentCallInfo",
|
|
382
|
-
value: function setCurrentCallInfo(data) {
|
|
383
|
-
this.currentCallInfo = data;
|
|
384
|
-
}
|
|
385
|
-
}, {
|
|
386
|
-
key: "startCall",
|
|
387
|
-
value: function () {
|
|
388
|
-
var _startCall = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
389
|
-
var _this$localUser, phoneUserId, userName;
|
|
390
|
-
return _regenerator["default"].wrap(function (_context2) {
|
|
391
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
392
|
-
case 0:
|
|
393
|
-
_this$localUser = this.localUser, phoneUserId = _this$localUser.userId, userName = _this$localUser.userName;
|
|
394
|
-
this.calling = true;
|
|
395
|
-
this.outgoingCall = true;
|
|
396
|
-
this.isHangup = false;
|
|
397
|
-
if (this.currentCallInfo.phone) {
|
|
398
|
-
_context2.next = 1;
|
|
399
|
-
break;
|
|
400
|
-
}
|
|
401
|
-
return _context2.abrupt("return");
|
|
402
|
-
case 1:
|
|
403
|
-
_context2.next = 2;
|
|
404
|
-
return this._roomControl.getRoomConnectorControl().startSessionByPhone({
|
|
405
|
-
phoneNumber: this.currentCallInfo.phone,
|
|
406
|
-
userName: userName,
|
|
407
|
-
phoneUserId: phoneUserId
|
|
408
|
-
});
|
|
409
|
-
case 2:
|
|
410
|
-
this._sessionId = _context2.sent;
|
|
411
|
-
case 3:
|
|
412
|
-
case "end":
|
|
413
|
-
return _context2.stop();
|
|
414
|
-
}
|
|
415
|
-
}, _callee2, this);
|
|
416
|
-
}));
|
|
417
|
-
function startCall() {
|
|
418
|
-
return _startCall.apply(this, arguments);
|
|
419
|
-
}
|
|
420
|
-
return startCall;
|
|
421
|
-
}()
|
|
422
|
-
}, {
|
|
423
|
-
key: "stopCall",
|
|
424
|
-
value: function () {
|
|
425
|
-
var _stopCall = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
426
|
-
var _t;
|
|
427
|
-
return _regenerator["default"].wrap(function (_context3) {
|
|
428
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
429
|
-
case 0:
|
|
430
|
-
this.isHangup = true;
|
|
431
|
-
_t = this.connectSession;
|
|
432
|
-
if (!_t) {
|
|
433
|
-
_context3.next = 1;
|
|
434
|
-
break;
|
|
435
|
-
}
|
|
436
|
-
_context3.next = 1;
|
|
437
|
-
return this._roomControl.getRoomConnectorControl().stopSession(this.connectSession.sessionId);
|
|
438
|
-
case 1:
|
|
439
|
-
this._messageProvider.showToastByKey({
|
|
440
|
-
key: _type4.FcrUIToastKey.FMT_PSTN_STATUS_HUNGUP
|
|
441
|
-
});
|
|
442
|
-
case 2:
|
|
443
|
-
case "end":
|
|
444
|
-
return _context3.stop();
|
|
445
|
-
}
|
|
446
|
-
}, _callee3, this);
|
|
447
|
-
}));
|
|
448
|
-
function stopCall() {
|
|
449
|
-
return _stopCall.apply(this, arguments);
|
|
450
|
-
}
|
|
451
|
-
return stopCall;
|
|
452
|
-
}()
|
|
453
|
-
}, {
|
|
454
|
-
key: "setRememberMe",
|
|
455
|
-
value: function setRememberMe(value) {
|
|
456
|
-
this.rememberMe = value;
|
|
457
|
-
}
|
|
458
|
-
}, {
|
|
459
|
-
key: "initRememberedData",
|
|
460
|
-
value: function initRememberedData() {
|
|
461
|
-
var list = _tools.storage.get('connection_list');
|
|
462
|
-
if (!list) {
|
|
463
|
-
this.rememberedNumberList = [];
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
try {
|
|
467
|
-
this.rememberedNumberList = JSON.parse(list);
|
|
468
|
-
var _this$rememberedNumbe = this.rememberedNumberList[0],
|
|
469
|
-
phone = _this$rememberedNumbe.phone,
|
|
470
|
-
zone = _this$rememberedNumbe.zone;
|
|
471
|
-
this.setCurrentCallInfo({
|
|
472
|
-
zone: zone,
|
|
473
|
-
phone: phone
|
|
474
|
-
});
|
|
475
|
-
} catch (_unused) {
|
|
476
|
-
this.rememberedNumberList = [];
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}, {
|
|
480
|
-
key: "release",
|
|
481
|
-
value: function release() {
|
|
482
|
-
this._disposers.forEach(function (disposer) {
|
|
483
|
-
return disposer();
|
|
484
|
-
});
|
|
485
|
-
this._deviceProvider.removeObserver(this._deviceObserver);
|
|
486
|
-
this._roomControl.getRoomConnectorControl().removeObserver(this._roomOberver);
|
|
487
|
-
this._streamControl.removeObserver(this._streamObserver);
|
|
488
|
-
this._failureTimer && clearTimeout(this._failureTimer);
|
|
489
|
-
this._failureTimer = null;
|
|
490
|
-
}
|
|
491
|
-
}, {
|
|
492
|
-
key: "joinAudioByComputer",
|
|
493
|
-
value: function () {
|
|
494
|
-
var _joinAudioByComputer = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
495
|
-
var shouldIncludeMicrophone, hasOpenMicrophonePrivilege, includeMicrophone;
|
|
496
|
-
return _regenerator["default"].wrap(function (_context4) {
|
|
497
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
498
|
-
case 0:
|
|
499
|
-
if (!(this._sharedDevicePrivilegeDataSource && this._devicePrivilegeProvider)) {
|
|
500
|
-
_context4.next = 2;
|
|
501
|
-
break;
|
|
502
|
-
}
|
|
503
|
-
shouldIncludeMicrophone = this._sharedDevicePrivilegeDataSource.shouldIncludeMicrophone;
|
|
504
|
-
_context4.next = 1;
|
|
505
|
-
return this._devicePrivilegeProvider.hasOpenMicrophonePrivilege();
|
|
506
|
-
case 1:
|
|
507
|
-
hasOpenMicrophonePrivilege = _context4.sent;
|
|
508
|
-
includeMicrophone = shouldIncludeMicrophone && hasOpenMicrophonePrivilege;
|
|
509
|
-
this._deviceProvider.connectAudio(includeMicrophone);
|
|
510
|
-
case 2:
|
|
511
|
-
case "end":
|
|
512
|
-
return _context4.stop();
|
|
513
|
-
}
|
|
514
|
-
}, _callee4, this);
|
|
515
|
-
}));
|
|
516
|
-
function joinAudioByComputer() {
|
|
517
|
-
return _joinAudioByComputer.apply(this, arguments);
|
|
518
|
-
}
|
|
519
|
-
return joinAudioByComputer;
|
|
520
|
-
}()
|
|
521
|
-
}, {
|
|
522
|
-
key: "stopAudioByComputer",
|
|
523
|
-
value: function stopAudioByComputer() {
|
|
524
|
-
this._deviceProvider.disconnectAudio();
|
|
525
|
-
}
|
|
526
|
-
}, {
|
|
527
|
-
key: "_setResetTimer",
|
|
528
|
-
value: function _setResetTimer() {
|
|
529
|
-
var _this2 = this;
|
|
530
|
-
var reset = function reset() {
|
|
531
|
-
_this2.outgoingCall = false;
|
|
532
|
-
_this2.phoneCallReason = _type.FcrRoomConnectorSessionReason.NONE;
|
|
533
|
-
_this2.phoneCallState = _type.FcrRoomConnectorSessionState.CALLING;
|
|
534
|
-
};
|
|
535
|
-
if (this.isHangup) return reset();
|
|
536
|
-
this._failureTimer = setTimeout(reset, 1500);
|
|
537
|
-
}
|
|
538
|
-
}, {
|
|
539
|
-
key: "_rememberNumber",
|
|
540
|
-
value: function _rememberNumber(zone, phone) {
|
|
541
|
-
var list = this.rememberedNumberList;
|
|
542
|
-
if (!zone || !phone) return;
|
|
543
|
-
if (list.length < 6) {
|
|
544
|
-
if (!list.some(function (item) {
|
|
545
|
-
return (0, _isEqual["default"])(item, {
|
|
546
|
-
zone: zone,
|
|
547
|
-
phone: phone
|
|
548
|
-
});
|
|
549
|
-
})) {
|
|
550
|
-
list.unshift({
|
|
551
|
-
zone: zone,
|
|
552
|
-
phone: phone
|
|
553
|
-
});
|
|
554
|
-
this.rememberedNumberList = list;
|
|
555
|
-
_tools.storage.set('connection_list', JSON.stringify(list));
|
|
556
|
-
}
|
|
557
|
-
} else {
|
|
558
|
-
var result = list.filter(function (item) {
|
|
559
|
-
return (0, _isEqual["default"])(item, {
|
|
560
|
-
zone: zone,
|
|
561
|
-
phone: phone
|
|
562
|
-
});
|
|
563
|
-
});
|
|
564
|
-
result.unshift({
|
|
565
|
-
zone: zone,
|
|
566
|
-
phone: phone
|
|
567
|
-
});
|
|
568
|
-
this.rememberedNumberList = result;
|
|
569
|
-
_tools.storage.set('connection_list', JSON.stringify(result));
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}, {
|
|
573
|
-
key: "_phoneCallUpdated",
|
|
574
|
-
value: function _phoneCallUpdated(session, state, reason) {
|
|
575
|
-
if (this._sessionId !== session.sessionId) return;
|
|
576
|
-
this.connectSession = session;
|
|
577
|
-
this.calling = false;
|
|
578
|
-
switch (state) {
|
|
579
|
-
case _type.FcrRoomConnectorSessionState.RINGING:
|
|
580
|
-
this.phoneCallState = state;
|
|
581
|
-
this.phoneCallReason = reason;
|
|
582
|
-
break;
|
|
583
|
-
case _type.FcrRoomConnectorSessionState.CALLING:
|
|
584
|
-
this.phoneCallState = state;
|
|
585
|
-
this.phoneCallReason = reason;
|
|
586
|
-
break;
|
|
587
|
-
case _type.FcrRoomConnectorSessionState.END:
|
|
588
|
-
this.phoneCallState = state;
|
|
589
|
-
this.phoneCallReason = reason;
|
|
590
|
-
this._phoneCallReason(reason);
|
|
591
|
-
break;
|
|
592
|
-
default:
|
|
593
|
-
this.phoneCallState = _type.FcrRoomConnectorSessionState.CALLING;
|
|
594
|
-
break;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}, {
|
|
598
|
-
key: "_phoneCallReason",
|
|
599
|
-
value: function _phoneCallReason(reason) {
|
|
600
|
-
switch (reason) {
|
|
601
|
-
case _type.FcrRoomConnectorSessionReason.ACCEPTED:
|
|
602
|
-
// 已接听
|
|
603
|
-
this._messageProvider.showToastByKey({
|
|
604
|
-
key: _type4.FcrUIToastKey.FMT_PSTN_STATUS_VOICECONNECTED
|
|
605
|
-
});
|
|
606
|
-
this.closeConnectionDialog();
|
|
607
|
-
this._accepted = true;
|
|
608
|
-
break;
|
|
609
|
-
case _type.FcrRoomConnectorSessionReason.CANCELED:
|
|
610
|
-
case _type.FcrRoomConnectorSessionReason.LINE_BUSY:
|
|
611
|
-
case _type.FcrRoomConnectorSessionReason.NUMBER_ERROR:
|
|
612
|
-
case _type.FcrRoomConnectorSessionReason.REJECT:
|
|
613
|
-
case _type.FcrRoomConnectorSessionReason.SYSTEM_ERROR:
|
|
614
|
-
case _type.FcrRoomConnectorSessionReason.TIMEOUT:
|
|
615
|
-
case _type.FcrRoomConnectorSessionReason.UNREGISTER:
|
|
616
|
-
case _type.FcrRoomConnectorSessionReason.UNSUPPORTED:
|
|
617
|
-
case undefined:
|
|
618
|
-
this._setResetTimer();
|
|
619
|
-
this._accepted && this._rememberNumber(this.currentCallInfo.zone, this.currentCallInfo.phone);
|
|
620
|
-
this._accepted = false;
|
|
621
|
-
break;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}, {
|
|
625
|
-
key: "_setStreamState",
|
|
626
|
-
value: function _setStreamState() {
|
|
627
|
-
var matchPSTN = function matchPSTN(_ref3) {
|
|
628
|
-
var connectorType = _ref3.connectorType;
|
|
629
|
-
return connectorType === _fcrCore.FcrRoomConnectorType.PSTN;
|
|
630
|
-
};
|
|
631
|
-
var userId = this.localUser.userId;
|
|
632
|
-
var myStreams = this._streamControl.getStreamsByUserId(userId);
|
|
633
|
-
var allStreams = this._streamControl.getStreamList();
|
|
634
|
-
this.hasPstnStream = allStreams.some(matchPSTN);
|
|
635
|
-
this.hasNeedMergedStream = allStreams.some(function (stream) {
|
|
636
|
-
return stream.owner.connectorType === _fcrCore.FcrRoomConnectorType.PSTN && stream.connectorType === _fcrCore.FcrRoomConnectorType.PSTN;
|
|
637
|
-
});
|
|
638
|
-
if (this.hasOwnPstnStream) {
|
|
639
|
-
this._deviceProvider.setConnectType(_type2.FcrUIConnectType.PHONE);
|
|
640
|
-
}
|
|
641
|
-
return {
|
|
642
|
-
myStreams: myStreams,
|
|
643
|
-
userId: userId
|
|
644
|
-
};
|
|
645
|
-
}
|
|
646
|
-
}, {
|
|
647
|
-
key: "_handleStreamsAddedOrUpdated",
|
|
648
|
-
value: function _handleStreamsAddedOrUpdated() {
|
|
649
|
-
this._setStreamState();
|
|
650
|
-
}
|
|
651
|
-
}, {
|
|
652
|
-
key: "_handleStreamsRemoved",
|
|
653
|
-
value: function _handleStreamsRemoved(roomId, events) {
|
|
654
|
-
var _this3 = this;
|
|
655
|
-
var _this$_setStreamState = this._setStreamState(),
|
|
656
|
-
myStreams = _this$_setStreamState.myStreams,
|
|
657
|
-
userId = _this$_setStreamState.userId;
|
|
658
|
-
var _iterator = _createForOfIteratorHelper(events),
|
|
659
|
-
_step;
|
|
660
|
-
try {
|
|
661
|
-
var _loop = function _loop() {
|
|
662
|
-
var modifiedStream = _step.value.modifiedStream;
|
|
663
|
-
if (modifiedStream.connectorType !== _fcrCore.FcrRoomConnectorType.PSTN) return {
|
|
664
|
-
v: void 0
|
|
665
|
-
};
|
|
666
|
-
if (modifiedStream.owner.userId === userId && _this3._deviceProvider.connectType === _type2.FcrUIConnectType.PHONE) {
|
|
667
|
-
if (_this3._deviceProvider.isAudioConnected) {
|
|
668
|
-
_this3._deviceProvider.setConnectType(_type2.FcrUIConnectType.COMPUTER);
|
|
669
|
-
} else {
|
|
670
|
-
_this3._deviceProvider.setConnectType(_type2.FcrUIConnectType.NONE);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
if (myStreams.findIndex(function (stream) {
|
|
674
|
-
return stream.streamId === modifiedStream.streamId;
|
|
675
|
-
}) === -1 && _this3.connectSession) {
|
|
676
|
-
if (modifiedStream.owner.userId === userId) {
|
|
677
|
-
_this3._phoneCallUpdated(_this3.connectSession, _type.FcrRoomConnectorSessionState.END, _type.FcrRoomConnectorSessionReason.LINE_BUSY);
|
|
678
|
-
_this3.isHangup = true;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
_ret;
|
|
683
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
684
|
-
_ret = _loop();
|
|
685
|
-
if (_ret) return _ret.v;
|
|
686
|
-
}
|
|
687
|
-
} catch (err) {
|
|
688
|
-
_iterator.e(err);
|
|
689
|
-
} finally {
|
|
690
|
-
_iterator.f();
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}]);
|
|
694
|
-
}();
|
|
695
|
-
_ConnectionGatewayStore = ConnectionGatewayStore;
|
|
696
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_ConnectionGatewayStore, [[_mobx.observable, 1, "activeTabKey"], [_mobx.observable, 1, "rememberMe"], [_mobx.observable, 1, "rememberedNumberList"], [_mobx.observable, 1, "connectionPhoneInfo"], [_mobx.observable, 1, "currentRegion"], [_mobx.observable, 1, "currentCallInfo"], [_mobx.observable, 1, "connectInfo"], [_mobx.observable, 1, "phoneCallState"], [_mobx.observable, 1, "phoneCallReason"], [_mobx.observable, 1, "connectSession"], [_mobx.observable, 1, "calling"], [_mobx.observable, 1, "outgoingCall"], [_mobx.observable, 1, "isHangup"], [_mobx.observable, 1, "hasPstnStream"], [_mobx.observable, 1, "hasNeedMergedStream"], [_mobx.computed, 3, "connectType"], [_decorator.bound, 2, "openAudioSettings"], [_decorator.bound, 2, "closeConnectionDialog"], [_onTabChangeDecs, 18, "onTabChange"], [_onGetConnectInfoDecs, 18, "onGetConnectInfo"], [_regionChangeHandlerDecs, 18, "regionChangeHandler"], [_decorator.bound, 2, "setConnectionInfo"], [_decorator.bound, 2, "setCurrentCallInfo"], [_startCallDecs, 18, "startCall"], [_stopCallDecs, 18, "stopCall"], [_setRememberMeDecs, 18, "setRememberMe"], [_initRememberedDataDecs, 18, "initRememberedData"], [_decorator.bound, 2, "joinAudioByComputer"], [_decorator.bound, 2, "stopAudioByComputer"], [_decorator.bound, 2, "_setResetTimer"], [_rememberNumberDecs, 18, "_rememberNumber"], [_phoneCallUpdatedDecs, 18, "_phoneCallUpdated"], [_phoneCallReasonDecs, 18, "_phoneCallReason"], [_setStreamStateDecs, 18, "_setStreamState"], [_handleStreamsAddedOrUpdatedDecs, 18, "_handleStreamsAddedOrUpdated"], [_handleStreamsRemovedDecs, 18, "_handleStreamsRemoved"]], []).e, 16);
|
|
697
|
-
_init_activeTabKey = _applyDecs$e[0];
|
|
698
|
-
_init_rememberMe = _applyDecs$e[1];
|
|
699
|
-
_init_rememberedNumberList = _applyDecs$e[2];
|
|
700
|
-
_init_connectionPhoneInfo = _applyDecs$e[3];
|
|
701
|
-
_init_currentRegion = _applyDecs$e[4];
|
|
702
|
-
_init_currentCallInfo = _applyDecs$e[5];
|
|
703
|
-
_init_connectInfo = _applyDecs$e[6];
|
|
704
|
-
_init_phoneCallState = _applyDecs$e[7];
|
|
705
|
-
_init_phoneCallReason = _applyDecs$e[8];
|
|
706
|
-
_init_connectSession = _applyDecs$e[9];
|
|
707
|
-
_init_calling = _applyDecs$e[10];
|
|
708
|
-
_init_outgoingCall = _applyDecs$e[11];
|
|
709
|
-
_init_isHangup = _applyDecs$e[12];
|
|
710
|
-
_init_hasPstnStream = _applyDecs$e[13];
|
|
711
|
-
_init_hasNeedMergedStream = _applyDecs$e[14];
|
|
712
|
-
_initProto = _applyDecs$e[15];
|
|
713
|
-
var StoreContext = exports.StoreContext = /*#__PURE__*/(0, _react.createContext)(null);
|