fcr-ui-scene 3.1.0 → 3.1.1

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.
Files changed (119) hide show
  1. package/lib/base.d.ts +1 -0
  2. package/lib/common/event-store.d.ts +1 -0
  3. package/lib/electron/app.d.ts +1 -0
  4. package/lib/electron/app.js +140 -0
  5. package/lib/electron/default-options.d.ts +2 -0
  6. package/lib/electron/default-options.js +25 -0
  7. package/lib/electron/env.d.ts +5 -0
  8. package/lib/electron/env.js +13 -0
  9. package/lib/electron/index.d.ts +2 -0
  10. package/lib/electron/index.js +20 -0
  11. package/lib/electron/injections.d.ts +45 -0
  12. package/lib/electron/injections.js +689 -0
  13. package/lib/electron/main.d.ts +2 -0
  14. package/lib/electron/main.js +63 -0
  15. package/lib/electron/plugins/screenshot.d.ts +2 -0
  16. package/lib/electron/plugins/screenshot.js +49 -0
  17. package/lib/electron/preload.js +35 -0
  18. package/lib/electron/tools.d.ts +5 -0
  19. package/lib/electron/tools.js +57 -0
  20. package/lib/electron/window.d.ts +12 -0
  21. package/lib/electron/window.js +112 -0
  22. package/lib/fragments/control-bar/index.js +11 -1
  23. package/lib/fragments/share-screen-selection/selection-store.d.ts +1 -0
  24. package/lib/modules/action-bar/leave/assign-host.d.ts +1 -0
  25. package/lib/modules/action-bar/leave/leave-meeting.d.ts +1 -0
  26. package/lib/modules/action-bar/more/poppover-content.d.ts +1 -0
  27. package/lib/modules/chat/chat-select/index.d.ts +1 -0
  28. package/lib/modules/chat/demo-wrapper.d.ts +1 -0
  29. package/lib/modules/device-pretest/audio-preview/speaker-control.d.ts +1 -0
  30. package/lib/modules/device-pretest/index.d.ts +1 -0
  31. package/lib/modules/device-pretest/settings/video-effect.d.ts +1 -0
  32. package/lib/modules/invite/voip-invite.d.ts +1 -0
  33. package/lib/modules/layout/components/Aside.d.ts +1 -0
  34. package/lib/modules/layout/member-window/index.d.ts +1 -0
  35. package/lib/modules/layout/store.d.ts +1 -0
  36. package/lib/modules/whiteboard/index.d.ts +1 -0
  37. package/lib/plugins/browser-runtime-plugin.js +0 -3
  38. package/lib/runtime.d.ts +86 -0
  39. package/package.json +4 -3
  40. package/installer/icons/favicon.ico +0 -0
  41. package/installer/icons/favicon.png +0 -0
  42. package/installer/mac/entitlements.mac.plist +0 -16
  43. package/lib/common/device-streams-store.d.ts +0 -34
  44. package/lib/common/device-streams-store.js +0 -403
  45. package/lib/fragments/participant/context.d.ts +0 -3
  46. package/lib/fragments/participant/context.js +0 -9
  47. package/lib/fragments/participant/index.css +0 -20
  48. package/lib/fragments/participant/index.d.ts +0 -9
  49. package/lib/fragments/participant/index.js +0 -90
  50. package/lib/fragments/participant/room-control-drop-menu/index.css +0 -19
  51. package/lib/fragments/participant/room-control-drop-menu/index.d.ts +0 -2
  52. package/lib/fragments/participant/room-control-drop-menu/index.js +0 -134
  53. package/lib/fragments/participant/store.d.ts +0 -34
  54. package/lib/fragments/participant/store.js +0 -326
  55. package/lib/fragments/participant/view.d.ts +0 -2
  56. package/lib/fragments/participant/view.js +0 -86
  57. package/lib/fragments/state-bar/index.d.ts +0 -9
  58. package/lib/fragments/state-bar/index.js +0 -68
  59. package/lib/fragments/type.d.ts +0 -2
  60. package/lib/fragments/type.js +0 -6
  61. package/lib/modules/connection-gateway/components/computer/menu.d.ts +0 -0
  62. package/lib/modules/connection-gateway/components/computer/menu.js +0 -1
  63. package/lib/modules/device-settings/audio-settings/audio-settings.d.ts +0 -4
  64. package/lib/modules/device-settings/audio-settings/audio-settings.js +0 -297
  65. package/lib/modules/device-settings/audio-settings/index.css +0 -139
  66. package/lib/modules/device-settings/audio-settings/microphone-detection.d.ts +0 -2
  67. package/lib/modules/device-settings/audio-settings/microphone-detection.js +0 -68
  68. package/lib/modules/device-settings/audio-settings/speaker-detection.d.ts +0 -2
  69. package/lib/modules/device-settings/audio-settings/speaker-detection.js +0 -72
  70. package/lib/modules/device-settings/common/advance-link.d.ts +0 -3
  71. package/lib/modules/device-settings/common/advance-link.js +0 -27
  72. package/lib/modules/device-settings/common/index.css +0 -26
  73. package/lib/modules/device-settings/common/useNamespace.d.ts +0 -15
  74. package/lib/modules/device-settings/common/useNamespace.js +0 -66
  75. package/lib/modules/device-settings/context.d.ts +0 -3
  76. package/lib/modules/device-settings/context.js +0 -9
  77. package/lib/modules/device-settings/dialog-wrapper.d.ts +0 -2
  78. package/lib/modules/device-settings/dialog-wrapper.js +0 -110
  79. package/lib/modules/device-settings/general-settings/general-settings.d.ts +0 -4
  80. package/lib/modules/device-settings/general-settings/general-settings.js +0 -66
  81. package/lib/modules/device-settings/general-settings/index.css +0 -26
  82. package/lib/modules/device-settings/index.css +0 -109
  83. package/lib/modules/device-settings/index.d.ts +0 -21
  84. package/lib/modules/device-settings/index.dev.js +0 -112
  85. package/lib/modules/device-settings/index.js +0 -84
  86. package/lib/modules/device-settings/state/index.css +0 -211
  87. package/lib/modules/device-settings/state/index.d.ts +0 -4
  88. package/lib/modules/device-settings/state/index.js +0 -330
  89. package/lib/modules/device-settings/storage-settings/index.css +0 -91
  90. package/lib/modules/device-settings/storage-settings/storage-settings.d.ts +0 -3
  91. package/lib/modules/device-settings/storage-settings/storage-settings.js +0 -84
  92. package/lib/modules/device-settings/store.d.ts +0 -205
  93. package/lib/modules/device-settings/store.js +0 -1035
  94. package/lib/modules/device-settings/video-settings/camera-select.d.ts +0 -2
  95. package/lib/modules/device-settings/video-settings/camera-select.js +0 -51
  96. package/lib/modules/device-settings/video-settings/index.css +0 -327
  97. package/lib/modules/device-settings/video-settings/local-video-player.d.ts +0 -3
  98. package/lib/modules/device-settings/video-settings/local-video-player.js +0 -37
  99. package/lib/modules/device-settings/video-settings/mirror-toggle.d.ts +0 -2
  100. package/lib/modules/device-settings/video-settings/mirror-toggle.js +0 -62
  101. package/lib/modules/device-settings/video-settings/video-settings-basic.d.ts +0 -9
  102. package/lib/modules/device-settings/video-settings/video-settings-basic.js +0 -177
  103. package/lib/modules/device-settings/video-settings/video-settings.d.ts +0 -6
  104. package/lib/modules/device-settings/video-settings/video-settings.js +0 -185
  105. package/lib/modules/device-settings/view.d.ts +0 -10
  106. package/lib/modules/device-settings/view.js +0 -193
  107. package/lib/modules/layout/components/UserWindow.d.ts +0 -8
  108. package/lib/modules/layout/components/UserWindow.js +0 -513
  109. package/lib/modules/layout/hooks.d.ts +0 -14
  110. package/lib/modules/layout/hooks.js +0 -48
  111. package/lib/modules/share-screen/context.d.ts +0 -3
  112. package/lib/modules/share-screen/context.js +0 -9
  113. package/lib/modules/whiteboard/i18n/config.d.ts +0 -1
  114. package/lib/modules/whiteboard/i18n/config.js +0 -15
  115. package/lib/modules/whiteboard/i18n/en/index.d.ts +0 -32
  116. package/lib/modules/whiteboard/i18n/en/index.js +0 -38
  117. package/lib/modules/whiteboard/i18n/zh/index.d.ts +0 -32
  118. package/lib/modules/whiteboard/i18n/zh/index.js +0 -38
  119. /package/lib/{modules/device-settings/index.dev.d.ts → electron/preload.d.ts} +0 -0
@@ -1,1035 +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.slice.js");
12
- require("core-js/modules/es.date.to-primitive.js");
13
- require("core-js/modules/es.date.to-string.js");
14
- require("core-js/modules/es.function.name.js");
15
- require("core-js/modules/es.object.create.js");
16
- require("core-js/modules/es.object.define-properties.js");
17
- require("core-js/modules/es.object.define-property.js");
18
- require("core-js/modules/es.object.get-own-property-descriptor.js");
19
- require("core-js/modules/es.object.get-own-property-descriptors.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
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
24
- var _typeof = require("@babel/runtime/helpers/typeof");
25
- Object.defineProperty(exports, "__esModule", {
26
- value: true
27
- });
28
- Object.defineProperty(exports, "DEFAULT_BEAUTY_VALUE", {
29
- enumerable: true,
30
- get: function get() {
31
- return _localVideoPlayer.DEFAULT_BEAUTY_VALUE;
32
- }
33
- });
34
- exports["default"] = exports.DeviceSettingTab = void 0;
35
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
36
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
37
- require("core-js/modules/es.array.concat.js");
38
- require("core-js/modules/es.array.filter.js");
39
- require("core-js/modules/es.array.find.js");
40
- require("core-js/modules/es.array.for-each.js");
41
- require("core-js/modules/es.array.iterator.js");
42
- require("core-js/modules/es.array.push.js");
43
- require("core-js/modules/es.array.reduce.js");
44
- require("core-js/modules/es.function.bind.js");
45
- require("core-js/modules/es.map.js");
46
- require("core-js/modules/es.math.log10.js");
47
- require("core-js/modules/es.number.constructor.js");
48
- require("core-js/modules/es.number.to-fixed.js");
49
- require("core-js/modules/es.object.assign.js");
50
- require("core-js/modules/es.object.entries.js");
51
- require("core-js/modules/es.object.keys.js");
52
- require("core-js/modules/es.object.to-string.js");
53
- require("core-js/modules/es.string.iterator.js");
54
- require("core-js/modules/es.weak-map.js");
55
- require("core-js/modules/web.dom-collections.for-each.js");
56
- require("core-js/modules/web.dom-collections.iterator.js");
57
- require("core-js/modules/web.timers.js");
58
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
59
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
60
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
61
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
62
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
63
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
64
- var _agoraEduCore = require("agora-edu-core");
65
- var _logger = require("agora-foundation/lib/logger");
66
- var _mobx = require("mobx");
67
- var _type = require("agora-edu-core/lib/type");
68
- var _decorator = require("agora-foundation/lib/decorator");
69
- var _constant = require("../../utilities/constant");
70
- var _localVideoPlayer = require("agora-ui-foundation/lib/components/local-video-player");
71
- var _excluded = ["dialogId"];
72
- var _DeviceSettingsStore;
73
- var _initProto, _init_isWifiConnected, _init_dialogConfig, _init_networkState, _init_performanceState, _init_localAudioStreamMap, _init_remoteAudioStreamMap, _init_localVideoStreamMap, _init_remoteVideoStreamMap, _init_systemMemorySize, _init_systemCpuDesc, _init_setting, _init_config, _init_getSystemInfoTimer, _setDialogConfigDecs, _setSettingDecs, _onEventDecs, _onNetworkStatsUpdatedDecs, _calculateSystemInfoDecs, _getSystemInformationDecs, _clearGetSystemInfoIntervalDecs, _onLocalAudioStatsUpdatedDecs, _onRemoteAudioStatsUpdatedDecs, _onLocalVideoStatsUpdatedDecs, _onRemoteVideoStatsUpdatedDecs, _onStreamsUpdatedDecs, _onStreamsRemovedDecs, _onPerformanceUpdatedDecs, _closeDialogDecs, _ref;
74
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
75
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
76
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
77
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
78
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
79
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
80
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
81
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
82
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
83
- 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"); }
84
- 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)]; } }; }
85
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
86
- 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); }
87
- 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; }
88
- 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; }
89
- var DEFAULT_DEVICE_ID = 'default';
90
- var DeviceSettingTab = exports.DeviceSettingTab = /*#__PURE__*/function (DeviceSettingTab) {
91
- DeviceSettingTab["GENERAL"] = "general";
92
- DeviceSettingTab["AUDIO"] = "audio";
93
- DeviceSettingTab["VIDEO"] = "video";
94
- DeviceSettingTab["STORAGE"] = "storage";
95
- DeviceSettingTab["STATE"] = "state";
96
- return DeviceSettingTab;
97
- }({});
98
- var _A = /*#__PURE__*/new WeakMap();
99
- var _B = /*#__PURE__*/new WeakMap();
100
- var _C = /*#__PURE__*/new WeakMap();
101
- var _D = /*#__PURE__*/new WeakMap();
102
- var _E = /*#__PURE__*/new WeakMap();
103
- var _F = /*#__PURE__*/new WeakMap();
104
- var _G = /*#__PURE__*/new WeakMap();
105
- var _H = /*#__PURE__*/new WeakMap();
106
- var _I = /*#__PURE__*/new WeakMap();
107
- var _J = /*#__PURE__*/new WeakMap();
108
- var _K = /*#__PURE__*/new WeakMap();
109
- var _L = /*#__PURE__*/new WeakMap();
110
- var _M = /*#__PURE__*/new WeakMap();
111
- _ref = (_setDialogConfigDecs = [_mobx.action, _mobx.action.bound], _setSettingDecs = [_mobx.action, _mobx.action.bound], _onEventDecs = [_mobx.action, _mobx.action.bound], _onNetworkStatsUpdatedDecs = [_mobx.action, _mobx.action.bound], _calculateSystemInfoDecs = [_mobx.action, _mobx.action.bound], _getSystemInformationDecs = [_mobx.action, _mobx.action.bound], _clearGetSystemInfoIntervalDecs = [_mobx.action, _mobx.action.bound], _onLocalAudioStatsUpdatedDecs = [_mobx.action, _mobx.action.bound], _onRemoteAudioStatsUpdatedDecs = [_mobx.action, _mobx.action.bound], _onLocalVideoStatsUpdatedDecs = [_mobx.action, _mobx.action.bound], _onRemoteVideoStatsUpdatedDecs = [_mobx.action, _mobx.action.bound], _onStreamsUpdatedDecs = [_mobx.action, _mobx.action.bound], _onStreamsRemovedDecs = [_mobx.action, _mobx.action.bound], _onPerformanceUpdatedDecs = [_mobx.action, _mobx.action.bound], _closeDialogDecs = [_mobx.action, _mobx.action.bound], "_disposers");
112
- var DeviceSettingsStore = exports["default"] = /*#__PURE__*/function () {
113
- function DeviceSettingsStore(_ref2) {
114
- var mediaControl = _ref2.mediaControl,
115
- config = _ref2.config,
116
- uiEventStore = _ref2.uiEventStore,
117
- deviceStore = _ref2.deviceStore,
118
- monitorControl = _ref2.monitorControl,
119
- streamControl = _ref2.streamControl,
120
- roomControl = _ref2.roomControl;
121
- (0, _classCallCheck2["default"])(this, DeviceSettingsStore);
122
- (0, _defineProperty2["default"])(this, _ref, (_initProto(this), []));
123
- _classPrivateFieldInitSpec(this, _A, _init_isWifiConnected(this, false));
124
- _classPrivateFieldInitSpec(this, _B, _init_dialogConfig(this, {
125
- // activeTab: DeviceSettingTab.AUDIO,
126
- activeTab: DeviceSettingTab.STATE,
127
- highlightSelector: undefined
128
- }));
129
- _classPrivateFieldInitSpec(this, _C, _init_networkState(this, {
130
- txPacketLoss: -1,
131
- rxPacketLoss: -1,
132
- rtt: 0,
133
- txKBitRate: 0,
134
- rxKBitRate: 0,
135
- txAudioKBitrate: 0,
136
- txAudioKBytes: 0,
137
- rxAudioKBitrate: 0,
138
- rxAudioKBytes: 0,
139
- txVideoKBitrate: 0,
140
- txVideoKBytes: 0,
141
- rxVideoKBitrate: 0,
142
- rxVideoKBytes: 0
143
- }));
144
- _classPrivateFieldInitSpec(this, _D, _init_performanceState(this, {
145
- cpuTotalUsage: 0,
146
- cpuAppUsage: 0,
147
- cpuOtherAppUsage: 0,
148
- memoryAppUsageRatio: 0,
149
- memoryOtherAppUsageRatio: 0,
150
- memoryTotalUsageRatio: 0,
151
- memoryAppUsageInKbytes: 0,
152
- memoryOtherAppUsageInKbytes: 0
153
- }));
154
- _classPrivateFieldInitSpec(this, _E, _init_localAudioStreamMap(this, new Map()));
155
- _classPrivateFieldInitSpec(this, _F, _init_remoteAudioStreamMap(this, new Map()));
156
- _classPrivateFieldInitSpec(this, _G, _init_localVideoStreamMap(this, new Map()));
157
- _classPrivateFieldInitSpec(this, _H, _init_remoteVideoStreamMap(this, new Map()));
158
- _classPrivateFieldInitSpec(this, _I, _init_systemMemorySize(this, 0));
159
- _classPrivateFieldInitSpec(this, _J, _init_systemCpuDesc(this, ''));
160
- _classPrivateFieldInitSpec(this, _K, _init_setting(this, {
161
- shouldTurnOffVideo: true,
162
- shouldDisplayPreviewDialog: true,
163
- shouldHideNonVideoParticipants: false,
164
- displayedMaxAttendees: 16,
165
- autoAdjustmentSpeakerVolume: true,
166
- autoAdjustmentMicrophoneVolume: true,
167
- noiseReduce: _type.FcrAiDenoiseLevel.AUTO,
168
- showTurnOnAcoustic: true,
169
- recordingPath: '',
170
- videoHD: true,
171
- videoLowLight: true,
172
- hardwareForReception: true,
173
- videoNoise: true,
174
- audioHiFi: false,
175
- audioEchoCancellation: false,
176
- audioStereo: false,
177
- audioVoiceChanger: false,
178
- spotlightEnabled: true
179
- }));
180
- _classPrivateFieldInitSpec(this, _L, _init_config(this, undefined));
181
- _classPrivateFieldInitSpec(this, _M, _init_getSystemInfoTimer(this, null));
182
- (0, _defineProperty2["default"])(this, "logger", (0, _logger.getLogger)());
183
- (0, _defineProperty2["default"])(this, "_currentDialogId", '');
184
- this._mediaControl = mediaControl;
185
- this._monitorControl = monitorControl;
186
- this._streamControl = streamControl;
187
- this._roomControl = roomControl;
188
- this.config = config;
189
- this._uiEventStore = uiEventStore;
190
- this._deviceStore = deviceStore;
191
- this._uiEventStore.addObserver({
192
- onEvent: this._onEvent
193
- });
194
- this._monitorControl.addObserver({
195
- onPerformanceUpdated: this._onPerformanceUpdated
196
- });
197
- this._roomControl.addObserver({
198
- onNetworkStatsUpdated: this._onNetworkStatsUpdated
199
- });
200
- this._streamControl.addObserver({
201
- onLocalAudioStatsUpdated: this._onLocalAudioStatsUpdated,
202
- onRemoteAudioStatsUpdated: this._onRemoteAudioStatsUpdated,
203
- onLocalVideoStatsUpdated: this._onLocalVideoStatsUpdated,
204
- onRemoteVideoStatsUpdated: this._onRemoteVideoStatsUpdated,
205
- onStreamsRemoved: this._onStreamsRemoved,
206
- onStreamsUpdated: this._onStreamsUpdated
207
- });
208
- this.startMicrophoneTest = this.startMicrophoneTest.bind(this);
209
- this.stopMicrophoneTest = this.stopMicrophoneTest.bind(this);
210
- this.getSetting = this.getSetting.bind(this);
211
- this._syncSystemInfo();
212
- this._initReactions();
213
- }
214
- return (0, _createClass2["default"])(DeviceSettingsStore, [{
215
- key: "isWifiConnected",
216
- get: function get() {
217
- return _classPrivateFieldGet(_A, this);
218
- },
219
- set: function set(v) {
220
- _classPrivateFieldSet(_A, this, v);
221
- }
222
- }, {
223
- key: "dialogConfig",
224
- get: function get() {
225
- return _classPrivateFieldGet(_B, this);
226
- },
227
- set: function set(v) {
228
- _classPrivateFieldSet(_B, this, v);
229
- }
230
- }, {
231
- key: "networkState",
232
- get: function get() {
233
- return _classPrivateFieldGet(_C, this);
234
- },
235
- set: function set(v) {
236
- _classPrivateFieldSet(_C, this, v);
237
- }
238
- }, {
239
- key: "performanceState",
240
- get: function get() {
241
- return _classPrivateFieldGet(_D, this);
242
- },
243
- set: function set(v) {
244
- _classPrivateFieldSet(_D, this, v);
245
- }
246
- }, {
247
- key: "localAudioStreamMap",
248
- get: function get() {
249
- return _classPrivateFieldGet(_E, this);
250
- },
251
- set: function set(v) {
252
- _classPrivateFieldSet(_E, this, v);
253
- }
254
- }, {
255
- key: "remoteAudioStreamMap",
256
- get: function get() {
257
- return _classPrivateFieldGet(_F, this);
258
- },
259
- set: function set(v) {
260
- _classPrivateFieldSet(_F, this, v);
261
- }
262
- }, {
263
- key: "localVideoStreamMap",
264
- get: function get() {
265
- return _classPrivateFieldGet(_G, this);
266
- },
267
- set: function set(v) {
268
- _classPrivateFieldSet(_G, this, v);
269
- }
270
- }, {
271
- key: "remoteVideoStreamMap",
272
- get: function get() {
273
- return _classPrivateFieldGet(_H, this);
274
- },
275
- set: function set(v) {
276
- _classPrivateFieldSet(_H, this, v);
277
- }
278
- }, {
279
- key: "systemMemorySize",
280
- get: function get() {
281
- return _classPrivateFieldGet(_I, this);
282
- },
283
- set: function set(v) {
284
- _classPrivateFieldSet(_I, this, v);
285
- }
286
- }, {
287
- key: "systemCpuDesc",
288
- get: function get() {
289
- return _classPrivateFieldGet(_J, this);
290
- },
291
- set: function set(v) {
292
- _classPrivateFieldSet(_J, this, v);
293
- }
294
- }, {
295
- key: "setting",
296
- get: function get() {
297
- return _classPrivateFieldGet(_K, this);
298
- },
299
- set: function set(v) {
300
- _classPrivateFieldSet(_K, this, v);
301
- }
302
- }, {
303
- key: "config",
304
- get: function get() {
305
- return _classPrivateFieldGet(_L, this);
306
- },
307
- set: function set(v) {
308
- _classPrivateFieldSet(_L, this, v);
309
- }
310
- }, {
311
- key: "getSystemInfoTimer",
312
- get: function get() {
313
- return _classPrivateFieldGet(_M, this);
314
- },
315
- set: function set(v) {
316
- _classPrivateFieldSet(_M, this, v);
317
- }
318
- }, {
319
- key: "maxVideoSendInfo",
320
- get: function get() {
321
- return (0, _toConsumableArray2["default"])(this.localVideoStreamMap.values()).filter(function (item) {
322
- return !item.isScreenStream;
323
- }).reduce(function (maxItem, item) {
324
- if (!maxItem) return item;
325
- if (item.dimensions.width * item.dimensions.height > maxItem.dimensions.width * maxItem.dimensions.height) {
326
- return item;
327
- }
328
- return maxItem;
329
- }, null);
330
- }
331
- }, {
332
- key: "maxVideoReceiveInfo",
333
- get: function get() {
334
- return (0, _toConsumableArray2["default"])(this.remoteVideoStreamMap.values()).filter(function (item) {
335
- return !item.isScreenStream;
336
- }).reduce(function (maxItem, item) {
337
- if (!maxItem) return item;
338
- if (item.dimensions.width * item.dimensions.height > maxItem.dimensions.width * maxItem.dimensions.height) {
339
- return item;
340
- }
341
- return maxItem;
342
- }, null);
343
- }
344
- }, {
345
- key: "sendScreenShareInfo",
346
- get: function get() {
347
- return (0, _toConsumableArray2["default"])(this.localVideoStreamMap.values()).find(function (x) {
348
- return x.isScreenStream;
349
- }) || null;
350
- }
351
- }, {
352
- key: "receiveScreenShareInfo",
353
- get: function get() {
354
- return (0, _toConsumableArray2["default"])(this.remoteVideoStreamMap.values()).find(function (x) {
355
- return x.isScreenStream;
356
- }) || null;
357
- }
358
- }, {
359
- key: "microphoneVolumeDb",
360
- get: function get() {
361
- // 90 + 10*log10((float)volume / 100)
362
- if (this._deviceStore.microphoneVolumeLevel === 0) {
363
- return '0';
364
- }
365
- return (90 + 10 * Math.log10(this._deviceStore.microphoneVolumeLevel / 100)).toFixed(1);
366
- }
367
- }, {
368
- key: "speakerVolumeDb",
369
- get: function get() {
370
- if (this._deviceStore.speakerVolumeLevel === 0) {
371
- return '0';
372
- }
373
- return (90 + 10 * Math.log10(this._deviceStore.speakerVolumeLevel / 100)).toFixed(1);
374
- }
375
- }, {
376
- key: "speakerVolumeLevel",
377
- get: function get() {
378
- return this._deviceStore.speakerVolumeLevel;
379
- }
380
- }, {
381
- key: "speakerVolume",
382
- get: function get() {
383
- return this._deviceStore.speakerVolume;
384
- }
385
- }, {
386
- key: "microphoneVolumeLevel",
387
- get: function get() {
388
- return this._deviceStore.microphoneVolumeLevel;
389
- }
390
- }, {
391
- key: "microphoneVolume",
392
- get: function get() {
393
- return this._deviceStore.microphoneVolume;
394
- }
395
- }, {
396
- key: "isLocalMirrorEnabled",
397
- get: function get() {
398
- return this._deviceStore.isLocalMirrorEnabled;
399
- }
400
- }, {
401
- key: "isLocalEditBeautyOptions",
402
- get: function get() {
403
- return this._deviceStore.isLocalEditBeautyOptions;
404
- }
405
- }, {
406
- key: "currentBeautyKey",
407
- get: function get() {
408
- return this._deviceStore.currentBeautyKey;
409
- }
410
- }, {
411
- key: "beautyOptions",
412
- get: function get() {
413
- return this._deviceStore.beautyOptions;
414
- }
415
- }, {
416
- key: "cameraDeviceId",
417
- get: function get() {
418
- return this._deviceStore.cameraId;
419
- }
420
- }, {
421
- key: "cameraEnabled",
422
- get: function get() {
423
- return this._deviceStore.cameraEnabled;
424
- }
425
- }, {
426
- key: "showForceOpenEffectDialog",
427
- get: function get() {
428
- return this._deviceStore.showForceOpenEffectDialog;
429
- }
430
- }, {
431
- key: "currentVirtualBackgroundName",
432
- get: function get() {
433
- return this._deviceStore.currentVirtualBackgroundName;
434
- }
435
- }, {
436
- key: "cameraDeviceList",
437
- get: function get() {
438
- return this._deviceStore.cameraDeviceList;
439
- }
440
- }, {
441
- key: "microphoneDeviceId",
442
- get: function get() {
443
- return this._deviceStore.microphoneDeviceId;
444
- }
445
- }, {
446
- key: "speakerDeviceId",
447
- get: function get() {
448
- return this._deviceStore.speakerDeviceId;
449
- }
450
- }, {
451
- key: "speakerDeviceList",
452
- get: function get() {
453
- return this._deviceStore.speakerDeviceList;
454
- }
455
- }, {
456
- key: "microphoneDeviceList",
457
- get: function get() {
458
- return this._deviceStore.microphoneDeviceList;
459
- }
460
- }, {
461
- key: "enableBeauty",
462
- get: function get() {
463
- return this._deviceStore.enableBeauty;
464
- }
465
- }, {
466
- key: "enableVirtualBackground",
467
- value: function enableVirtualBackground(enable, source) {
468
- this._deviceStore.enableVirtualBackground(enable, source);
469
- }
470
- }, {
471
- key: "setEditBeautyKey",
472
- value: function setEditBeautyKey(key) {
473
- this._deviceStore.setEditBeautyKey(key);
474
- }
475
- }, {
476
- key: "enableBeautyEffect",
477
- value: function enableBeautyEffect(enable) {
478
- this._deviceStore.enableBeautyEffect(enable);
479
- }
480
- }, {
481
- key: "_initReactions",
482
- value: function _initReactions() {
483
- var _this = this;
484
- this._disposers.push((0, _mobx.reaction)(function () {
485
- return _this.setting;
486
- }, function (setting) {
487
- _this._uiEventStore.notifyCustomSettingsChanged(setting);
488
- }));
489
- }
490
- }, {
491
- key: "_disposeReactions",
492
- value: function _disposeReactions() {
493
- this._disposers.forEach(function (disposer) {
494
- return disposer();
495
- });
496
- this._disposers = [];
497
- }
498
-
499
- // TODO:
500
- // private async _initCameraDevices() {
501
- // const cameraList = await this._mediaControl.getCameraList();
502
- // this.cameraDeviceList.push(...mapDevice2Option(cameraList));
503
- // if (!this.cameraDeviceId && cameraList.length > 0) {
504
- // this.setCameraDevice(cameraList[0].deviceId);
505
- // }
506
- // }
507
- }, {
508
- key: "setCameraDevice",
509
- value: function setCameraDevice(id) {
510
- this._deviceStore.setCameraId(id);
511
- }
512
- }, {
513
- key: "setMicrophoneDevice",
514
- value: function setMicrophoneDevice(deviceId) {
515
- this._deviceStore.setMicrophoneDevice(deviceId);
516
- }
517
- }, {
518
- key: "stopSpeakerTest",
519
- value: function stopSpeakerTest() {
520
- this._deviceStore.stopSpeakerTest();
521
- }
522
- }, {
523
- key: "startSpeakerTest",
524
- value: function startSpeakerTest() {
525
- this._deviceStore.startSpeakerTest();
526
- }
527
- }, {
528
- key: "setSpeakerDevice",
529
- value: function setSpeakerDevice(deviceId) {
530
- this._deviceStore.setSpeakerDevice(deviceId);
531
- }
532
- }, {
533
- key: "setSpeakerVolume",
534
- value: function setSpeakerVolume(value) {
535
- this._deviceStore.setSpeakerVolume(value);
536
- }
537
- }, {
538
- key: "setMicrophoneVolume",
539
- value: function setMicrophoneVolume(value) {
540
- this._deviceStore.setMicrophoneVolume(value);
541
- }
542
- }, {
543
- key: "setVideoOrientation",
544
- value: function setVideoOrientation() {
545
- return this._deviceStore.setVideoOrientation();
546
- }
547
- }, {
548
- key: "setBeautyOptions",
549
- value: function setBeautyOptions(beautyOption) {
550
- return this._deviceStore.setBeautyOptions(beautyOption);
551
- }
552
- }, {
553
- key: "toggleLocalMirrorPreview",
554
- value: function toggleLocalMirrorPreview(isMirror) {
555
- if (!this._videoView4Setting || !this._deviceStore.cameraId) return;
556
- this.stopVideo();
557
- this.startVideo(isMirror);
558
- // set mirror for layout
559
- this._deviceStore.toggleLocalMirrorPreview(isMirror);
560
- }
561
- }, {
562
- key: "startVideo",
563
- value: function startVideo(isMirror) {
564
- var view = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this._videoView4Setting;
565
- if (!view) return;
566
- this._videoView4Setting = view;
567
- this._deviceStore.startVideoWithView(view, isMirror);
568
- }
569
- }, {
570
- key: "stopVideo",
571
- value: function stopVideo() {
572
- if (!this._videoView4Setting) return;
573
- this._deviceStore.stopVideoWithView(this._videoView4Setting);
574
- }
575
- }, {
576
- key: "handleForceOpenVideoEffect",
577
- value: function handleForceOpenVideoEffect() {
578
- return this._deviceStore.handleForceOpenVideoEffect();
579
- }
580
- }, {
581
- key: "handleCancelForceOpenVideoEffect",
582
- value: function handleCancelForceOpenVideoEffect() {
583
- return this._deviceStore.handleCancelForceOpenVideoEffect();
584
- }
585
- }, {
586
- key: "toggleLocalMirror",
587
- value: function toggleLocalMirror(enable) {
588
- if (!this._videoView4Setting || !this._deviceStore.cameraId) return;
589
- this.stopVideo();
590
- this.startVideo(enable);
591
- this._deviceStore.toggleLocalMirror(enable);
592
- }
593
- }, {
594
- key: "_syncSystemInfo",
595
- value: function () {
596
- var _syncSystemInfo2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
597
- var _this2 = this;
598
- var _yield$window$runtime, isWifiConnected;
599
- return _regenerator["default"].wrap(function _callee$(_context) {
600
- while (1) switch (_context.prev = _context.next) {
601
- case 0:
602
- _context.next = 2;
603
- return window.runtime.getNetworkType();
604
- case 2:
605
- _yield$window$runtime = _context.sent;
606
- isWifiConnected = _yield$window$runtime.isWifiConnected;
607
- // const { cpuUsage, memoryUsage, totalCpuUsage, totalMemoryUsage } =
608
- // await window.runtime.getRendererProcessUsage();
609
-
610
- (0, _mobx.runInAction)(function () {
611
- var cpus = window.runtime.getSystemCpuInfo();
612
- var cpuInfo = cpus.length === 0 ? '' : "".concat(cpus.length, "-").concat(cpus[0].model);
613
- _this2.systemCpuDesc = cpuInfo;
614
- _this2.systemMemorySize = window.runtime.getSystemMemorySize() / 1024;
615
- _this2.isWifiConnected = isWifiConnected;
616
-
617
- // this.performanceState.cpuAppUsage = Number(cpuUsage.toFixed(2));
618
- // this.performanceState.cpuOtherAppUsage = Number((totalCpuUsage - cpuUsage).toFixed(2));
619
- // this.performanceState.cpuTotalUsage = totalCpuUsage;
620
- // this.performanceState.memoryAppUsageRatio = (memoryUsage / totalMemoryUsage) * 100;
621
- // this.performanceState.memoryAppUsageInKbytes = memoryUsage / 1024;
622
- // this.performanceState.memoryOtherAppUsageInKbytes = (totalMemoryUsage - memoryUsage) / 1024;
623
- // this.performanceState.memoryOtherAppUsageRatio = (totalMemoryUsage - memoryUsage) / 1024;
624
- // this.performanceState.memoryTotalUsageRatio = (memoryUsage / totalMemoryUsage) * 100;
625
- });
626
- case 5:
627
- case "end":
628
- return _context.stop();
629
- }
630
- }, _callee);
631
- }));
632
- function _syncSystemInfo() {
633
- return _syncSystemInfo2.apply(this, arguments);
634
- }
635
- return _syncSystemInfo;
636
- }()
637
- }, {
638
- key: "getSetting",
639
- value: function getSetting() {
640
- return _objectSpread(_objectSpread({}, this.setting), {}, {
641
- cameraDeviceId: this._deviceStore.cameraId,
642
- isLocalMirrorEnabled: this._deviceStore.isLocalMirrorEnabled,
643
- speakerDeviceId: this._deviceStore.speakerDeviceId,
644
- speakerVolume: this._deviceStore.speakerVolume,
645
- microphoneDeviceId: this._deviceStore.microphoneDeviceId,
646
- microphoneVolume: this._deviceStore.microphoneVolume
647
- });
648
- }
649
-
650
- // 开启视频高清
651
- }, {
652
- key: "_enableVideoHd",
653
- value: function _enableVideoHd(enable) {
654
- var _this$config$dualCame, _this$config;
655
- console.log('开启视频高清', enable);
656
- if (!this._deviceStore.cameraId) return;
657
- var track = this._mediaControl.getCameraVideoTrack(this._deviceStore.cameraId);
658
- if (enable) {
659
- track.setCaptureParams({
660
- dimensions: {
661
- width: 1920,
662
- height: 1080
663
- },
664
- isMirror: this._deviceStore.currentIsMirror,
665
- frameRate: 5
666
- });
667
- return;
668
- }
669
- var _ref3 = (_this$config$dualCame = (_this$config = this.config) === null || _this$config === void 0 ? void 0 : _this$config.dualCameraVideoStreamConfig) !== null && _this$config$dualCame !== void 0 ? _this$config$dualCame : {},
670
- highVideoEncoderConfig = _ref3.highVideoEncoderConfig;
671
- if (highVideoEncoderConfig) {
672
- track.setCaptureParams(_objectSpread(_objectSpread({}, highVideoEncoderConfig), {}, {
673
- isMirror: this._deviceStore.currentIsMirror
674
- }));
675
- }
676
- }
677
-
678
- // 调整以适应弱光
679
- }, {
680
- key: "_enableLowlightEnhancement",
681
- value: function _enableLowlightEnhancement(enable) {
682
- console.log('调整以适应弱光', enable);
683
- if (!this._deviceStore.cameraId) return;
684
- var track = this._mediaControl.getCameraVideoTrack(this._deviceStore.cameraId);
685
- if (enable) {
686
- track.getVideoEffectEnhancer().enableLowlightEnhancement();
687
- } else {
688
- track.getVideoEffectEnhancer().disableLowlightEnhancement();
689
- }
690
- }
691
- // 视频降噪
692
- }, {
693
- key: "_enableVideoDenoiser",
694
- value: function _enableVideoDenoiser(enable) {
695
- if (!this._deviceStore.cameraId) return;
696
- var track = this._mediaControl.getCameraVideoTrack(this._deviceStore.cameraId);
697
- if (enable) {
698
- track.getVideoEffectEnhancer().enableVideoDenoiser();
699
- } else {
700
- track.getVideoEffectEnhancer().disableVideoDenoiser();
701
- }
702
- }
703
-
704
- // 硬件加速
705
- }, {
706
- key: "_enableHardwareForReception",
707
- value: function _enableHardwareForReception(enable) {
708
- if (!this._deviceStore.cameraId) return;
709
- var track = this._mediaControl.getCameraVideoTrack(this._deviceStore.cameraId);
710
- if (enable) {
711
- track.getVideoEffectEnhancer().enableHardwareEncoder();
712
- } else {
713
- track.getVideoEffectEnhancer().disableHardwareEncoder();
714
- }
715
- }
716
-
717
- // 高保真
718
- }, {
719
- key: "_enableAudioHiFiMode",
720
- value: function _enableAudioHiFiMode(enable) {
721
- if (!this._deviceStore.microphoneDeviceId) return;
722
- this._deviceStore.microphoneAudioTrack = this._mediaControl.getMicrophoneAudioTrack(this._deviceStore.microphoneDeviceId);
723
- if (enable) {
724
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().enableHiFiMode();
725
- return;
726
- }
727
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().disableHiFiMode();
728
- }
729
-
730
- // 回声消除
731
- }, {
732
- key: "_enableAudioEchoCancellation",
733
- value: function _enableAudioEchoCancellation(enable) {
734
- if (!this._deviceStore.microphoneDeviceId) return;
735
- this._deviceStore.microphoneAudioTrack = this._mediaControl.getMicrophoneAudioTrack(this._deviceStore.microphoneDeviceId);
736
- if (enable) {
737
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().enableEchoCancellation();
738
- return;
739
- }
740
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().disableEchoCancellation();
741
- }
742
-
743
- // 立体声
744
- }, {
745
- key: "_enableAudioStereo",
746
- value: function _enableAudioStereo(enable) {
747
- if (!this._deviceStore.microphoneDeviceId) return;
748
- this._deviceStore.microphoneAudioTrack = this._mediaControl.getMicrophoneAudioTrack(this._deviceStore.microphoneDeviceId);
749
- if (enable) {
750
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().enableStereoMode();
751
- return;
752
- }
753
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().disableStereoMode();
754
- }
755
-
756
- // 噪音抑制等级
757
- }, {
758
- key: "_setNoiseLevel",
759
- value: function _setNoiseLevel(level) {
760
- if (!this._deviceStore.microphoneDeviceId) return;
761
- this._deviceStore.microphoneAudioTrack = this._mediaControl.getMicrophoneAudioTrack(this._deviceStore.microphoneDeviceId);
762
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().enableAiDenoiser();
763
- this._deviceStore.microphoneAudioTrack.getAudioEffectEnhancer().setAiDenoiseLevel(level);
764
- }
765
- }, {
766
- key: "startMicrophoneTest",
767
- value: function startMicrophoneTest() {
768
- var _this$_deviceStore;
769
- if (!this._deviceStore.microphoneDeviceId) return;
770
- this._deviceStore.microphoneAudioTrack = this._mediaControl.getMicrophoneAudioTrack(this._deviceStore.microphoneDeviceId);
771
- if (this.setting.noiseReduce !== _type.FcrAiDenoiseLevel.AUTO) {
772
- var _this$_deviceStore$mi, _this$_deviceStore$mi2;
773
- (_this$_deviceStore$mi = this._deviceStore.microphoneAudioTrack) === null || _this$_deviceStore$mi === void 0 || _this$_deviceStore$mi.getAudioEffectEnhancer().enableAiDenoiser();
774
- (_this$_deviceStore$mi2 = this._deviceStore.microphoneAudioTrack) === null || _this$_deviceStore$mi2 === void 0 || _this$_deviceStore$mi2.getAudioEffectEnhancer().setAiDenoiseLevel(this.setting.noiseReduce);
775
- }
776
- this._mediaControl.enableAudioVolumeIndication(500, 1);
777
- (_this$_deviceStore = this._deviceStore) === null || _this$_deviceStore === void 0 || _this$_deviceStore.microphoneAudioTrack.startTest(500);
778
- }
779
- }, {
780
- key: "stopMicrophoneTest",
781
- value: function stopMicrophoneTest() {
782
- this._deviceStore.stopMicrophoneTest();
783
- }
784
- }, {
785
- key: "release",
786
- value: function release() {
787
- if (this.getSystemInfoTimer) {
788
- this.clearGetSystemInfoInterval();
789
- }
790
- this._monitorControl.removeObserver({
791
- onPerformanceUpdated: this._onPerformanceUpdated
792
- });
793
- this._disposeReactions();
794
- }
795
- }, {
796
- key: "setDialogConfig",
797
- value: function setDialogConfig(dialogConfig) {
798
- Object.assign(this.dialogConfig, dialogConfig);
799
- }
800
- }, {
801
- key: "setSetting",
802
- value: function setSetting(newSetting) {
803
- var _this3 = this;
804
- this.setting = _objectSpread(_objectSpread({}, this.setting), newSetting);
805
- if (newSetting.displayedMaxAttendees) {
806
- this._uiEventStore.toggleLayoutSize({
807
- size: newSetting.displayedMaxAttendees
808
- });
809
- }
810
- var settingActions = {
811
- autoAdjustmentMicrophoneVolume: function autoAdjustmentMicrophoneVolume(enable) {
812
- return _this3.setMicrophoneVolume(enable ? 100 : _this3._deviceStore.microphoneVolume);
813
- },
814
- // video
815
- videoHD: function videoHD(value) {
816
- return _this3._enableVideoHd(value);
817
- },
818
- videoLowLight: function videoLowLight(value) {
819
- return _this3._enableLowlightEnhancement(value);
820
- },
821
- hardwareForReception: function hardwareForReception(value) {
822
- return _this3._enableHardwareForReception(value);
823
- },
824
- videoNoise: function videoNoise(value) {
825
- return _this3._enableVideoDenoiser(value);
826
- },
827
- // audio
828
- audioHiFi: function audioHiFi(value) {
829
- return _this3._enableAudioHiFiMode(value);
830
- },
831
- audioEchoCancellation: function audioEchoCancellation(value) {
832
- return _this3._enableAudioEchoCancellation(value);
833
- },
834
- audioStereo: function audioStereo(value) {
835
- return _this3._enableAudioStereo(value);
836
- },
837
- noiseReduce: function noiseReduce(value) {
838
- return _this3._setNoiseLevel(value);
839
- }
840
- };
841
- for (var _i = 0, _Object$entries = Object.entries(newSetting); _i < _Object$entries.length; _i++) {
842
- var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
843
- _key = _Object$entries$_i[0],
844
- _value = _Object$entries$_i[1];
845
- if (settingActions[_key]) {
846
- settingActions[_key](_value);
847
- }
848
- }
849
- }
850
- }, {
851
- key: "_onEvent",
852
- value: function _onEvent(action, payload) {
853
- if (action === _constant.UIAction.OPEN_DEVICE_SETTING_DIALOG) {
854
- var _ref4 = payload,
855
- dialogId = _ref4.dialogId,
856
- config = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
857
- this._currentDialogId = dialogId;
858
- this.setDialogConfig(config);
859
- }
860
- }
861
- }, {
862
- key: "_onNetworkStatsUpdated",
863
- value: function _onNetworkStatsUpdated(roomId, stats) {
864
- for (var _i2 = 0, _arr = Object.keys(stats); _i2 < _arr.length; _i2++) {
865
- var _key2 = _arr[_i2];
866
- this.networkState[_key2] = Math.floor(stats[_key2]);
867
- }
868
- }
869
- }, {
870
- key: "calculateSystemInfo",
871
- value: function () {
872
- var _calculateSystemInfo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
873
- var _yield$window$runtime2, cpuUsage, memoryUsage, totalCpuUsage, totalMemoryUsage;
874
- return _regenerator["default"].wrap(function _callee2$(_context2) {
875
- while (1) switch (_context2.prev = _context2.next) {
876
- case 0:
877
- _context2.next = 2;
878
- return window.runtime.getRendererProcessUsage();
879
- case 2:
880
- _yield$window$runtime2 = _context2.sent;
881
- cpuUsage = _yield$window$runtime2.cpuUsage;
882
- memoryUsage = _yield$window$runtime2.memoryUsage;
883
- totalCpuUsage = _yield$window$runtime2.totalCpuUsage;
884
- totalMemoryUsage = _yield$window$runtime2.totalMemoryUsage;
885
- this.performanceState.cpuAppUsage = Number(cpuUsage.toFixed(2));
886
- this.performanceState.cpuOtherAppUsage = Number((totalCpuUsage - cpuUsage).toFixed(2));
887
- this.performanceState.cpuTotalUsage = totalCpuUsage;
888
- this.performanceState.memoryAppUsageRatio = memoryUsage / totalMemoryUsage * 100;
889
- this.performanceState.memoryAppUsageInKbytes = memoryUsage / 1024;
890
- this.performanceState.memoryOtherAppUsageInKbytes = (totalMemoryUsage - memoryUsage) / 1024;
891
- this.performanceState.memoryOtherAppUsageRatio = (totalMemoryUsage - memoryUsage) / 1024;
892
- this.performanceState.memoryTotalUsageRatio = memoryUsage / totalMemoryUsage * 100;
893
- case 15:
894
- case "end":
895
- return _context2.stop();
896
- }
897
- }, _callee2, this);
898
- }));
899
- function calculateSystemInfo() {
900
- return _calculateSystemInfo.apply(this, arguments);
901
- }
902
- return calculateSystemInfo;
903
- }()
904
- }, {
905
- key: "getSystemInformation",
906
- value: function getSystemInformation() {
907
- if (!this.performanceState.cpuAppUsage && !this.performanceState.memoryAppUsageInKbytes) this.calculateSystemInfo();
908
- if (!this.getSystemInfoTimer) {
909
- this.getSystemInfoTimer = setInterval(this.calculateSystemInfo, 10000);
910
- }
911
- }
912
- }, {
913
- key: "clearGetSystemInfoInterval",
914
- value: function clearGetSystemInfoInterval() {
915
- this.getSystemInfoTimer && clearInterval(this.getSystemInfoTimer);
916
- this.getSystemInfoTimer = null;
917
- }
918
- }, {
919
- key: "_onLocalAudioStatsUpdated",
920
- value: function _onLocalAudioStatsUpdated(roomId, streamId, stats) {
921
- // console.log('onLocalAudioStatsUpdated', streamId, stats);
922
- this.localAudioStreamMap.set(streamId, stats);
923
- }
924
- }, {
925
- key: "_onRemoteAudioStatsUpdated",
926
- value: function _onRemoteAudioStatsUpdated(roomId, streamId, stats) {
927
- // console.log('onRemoteAudioStatsUpdated', streamId, stats);
928
-
929
- this.remoteAudioStreamMap.set(streamId, stats);
930
- }
931
- }, {
932
- key: "_onLocalVideoStatsUpdated",
933
- value: function _onLocalVideoStatsUpdated(roomId, streamId, stats) {
934
- var streamInfo = this._streamControl.getStreams()[streamId];
935
- // console.log('onLocalVideoStatsUpdated', streamId, stats, streamInfo);
936
- if (streamInfo.videoSourceState === _agoraEduCore.FcrMediaSourceState.STARTED) {
937
- this.localVideoStreamMap.set(streamId, _objectSpread(_objectSpread({}, stats), {}, {
938
- sendFrameRate: Math.max(0, stats.sendFrameRate),
939
- isScreenStream: streamInfo.videoSourceType === _type.FcrVideoSourceType.SCREEN
940
- }));
941
- }
942
- }
943
- }, {
944
- key: "_onRemoteVideoStatsUpdated",
945
- value: function _onRemoteVideoStatsUpdated(roomId, streamId, stats) {
946
- var streamInfo = this._streamControl.getStreams()[streamId];
947
- // console.log('onRemoteVideoStatsUpdated', streamId, stats, streamInfo);
948
- if (streamInfo.videoSourceState === _agoraEduCore.FcrMediaSourceState.STARTED) {
949
- this.remoteVideoStreamMap.set(streamId, _objectSpread(_objectSpread({}, stats), {}, {
950
- frameRate: Math.max(0, stats.frameRate),
951
- isScreenStream: streamInfo.videoSourceType === _type.FcrVideoSourceType.SCREEN
952
- }));
953
- }
954
- }
955
- }, {
956
- key: "_onStreamsUpdated",
957
- value: function _onStreamsUpdated(roomId, events) {
958
- // console.log('_onStreamsUpdated', events);
959
- var _iterator = _createForOfIteratorHelper(events),
960
- _step;
961
- try {
962
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
963
- var event = _step.value;
964
- if (event.modifiedStream.audioSourceState !== _agoraEduCore.FcrMediaSourceState.STARTED) {
965
- this.localAudioStreamMap["delete"](event.modifiedStream.streamId);
966
- this.remoteAudioStreamMap["delete"](event.modifiedStream.streamId);
967
- }
968
- if (event.modifiedStream.videoSourceState !== _agoraEduCore.FcrMediaSourceState.STARTED) {
969
- this.localVideoStreamMap["delete"](event.modifiedStream.streamId);
970
- this.remoteVideoStreamMap["delete"](event.modifiedStream.streamId);
971
- }
972
- }
973
- } catch (err) {
974
- _iterator.e(err);
975
- } finally {
976
- _iterator.f();
977
- }
978
- }
979
- }, {
980
- key: "_onStreamsRemoved",
981
- value: function _onStreamsRemoved(roomId, events) {
982
- // console.log('_onStreamsRemoved', events);
983
- var _iterator2 = _createForOfIteratorHelper(events),
984
- _step2;
985
- try {
986
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
987
- var event = _step2.value;
988
- this.localAudioStreamMap["delete"](event.modifiedStream.streamId);
989
- this.remoteAudioStreamMap["delete"](event.modifiedStream.streamId);
990
- this.localVideoStreamMap["delete"](event.modifiedStream.streamId);
991
- this.remoteVideoStreamMap["delete"](event.modifiedStream.streamId);
992
- }
993
- } catch (err) {
994
- _iterator2.e(err);
995
- } finally {
996
- _iterator2.f();
997
- }
998
- }
999
- }, {
1000
- key: "_onPerformanceUpdated",
1001
- value: function _onPerformanceUpdated(status) {
1002
- for (var _i3 = 0, _arr2 = Object.keys(status); _i3 < _arr2.length; _i3++) {
1003
- var _key3 = _arr2[_i3];
1004
- this.performanceState[_key3] = Math.floor(status[_key3]);
1005
- }
1006
- this.performanceState.cpuOtherAppUsage = this.performanceState.cpuTotalUsage - this.performanceState.cpuAppUsage;
1007
- this.performanceState.memoryOtherAppUsageRatio = this.performanceState.memoryTotalUsageRatio - this.performanceState.memoryAppUsageRatio;
1008
- this.performanceState.memoryOtherAppUsageInKbytes = this.systemMemorySize * this.performanceState.memoryTotalUsageRatio / 100 - this.performanceState.memoryAppUsageInKbytes;
1009
- // this.performanceState.memoryOtherAppUsageInKbytes =
1010
- // (this.performanceState.memoryTotalUsageRatio / this.performanceState.memoryAppUsageRatio) *
1011
- // this.performanceState.memoryAppUsageInKbytes;
1012
- }
1013
- }, {
1014
- key: "closeDialog",
1015
- value: function closeDialog() {
1016
- this._uiEventStore.closeDialog(this._currentDialogId);
1017
- }
1018
- }]);
1019
- }();
1020
- _DeviceSettingsStore = DeviceSettingsStore;
1021
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_DeviceSettingsStore, [[_mobx.observable, 1, "isWifiConnected"], [_mobx.observable, 1, "dialogConfig"], [_mobx.observable, 1, "networkState"], [_mobx.observable, 1, "performanceState"], [_mobx.observable, 1, "localAudioStreamMap"], [_mobx.observable, 1, "remoteAudioStreamMap"], [_mobx.observable, 1, "localVideoStreamMap"], [_mobx.observable, 1, "remoteVideoStreamMap"], [_mobx.observable, 1, "systemMemorySize"], [_mobx.observable, 1, "systemCpuDesc"], [_mobx.observable, 1, "setting"], [_mobx.observable, 1, "config"], [_mobx.observable, 1, "getSystemInfoTimer"], [_mobx.computed, 3, "maxVideoSendInfo"], [_mobx.computed, 3, "maxVideoReceiveInfo"], [_mobx.computed, 3, "sendScreenShareInfo"], [_mobx.computed, 3, "receiveScreenShareInfo"], [_mobx.computed, 3, "microphoneVolumeDb"], [_mobx.computed, 3, "speakerVolumeDb"], [_mobx.computed, 3, "speakerVolumeLevel"], [_mobx.computed, 3, "speakerVolume"], [_mobx.computed, 3, "microphoneVolumeLevel"], [_mobx.computed, 3, "microphoneVolume"], [_mobx.computed, 3, "isLocalMirrorEnabled"], [_mobx.computed, 3, "isLocalEditBeautyOptions"], [_mobx.computed, 3, "currentBeautyKey"], [_mobx.computed, 3, "beautyOptions"], [_mobx.computed, 3, "cameraDeviceId"], [_mobx.computed, 3, "cameraEnabled"], [_mobx.computed, 3, "showForceOpenEffectDialog"], [_mobx.computed, 3, "currentVirtualBackgroundName"], [_mobx.computed, 3, "cameraDeviceList"], [_mobx.computed, 3, "microphoneDeviceId"], [_mobx.computed, 3, "speakerDeviceId"], [_mobx.computed, 3, "speakerDeviceList"], [_mobx.computed, 3, "microphoneDeviceList"], [_mobx.computed, 3, "enableBeauty"], [_decorator.bound, 2, "enableVirtualBackground"], [_decorator.bound, 2, "setEditBeautyKey"], [_decorator.bound, 2, "enableBeautyEffect"], [_decorator.bound, 2, "_initReactions"], [_decorator.bound, 2, "setCameraDevice"], [_decorator.bound, 2, "setMicrophoneDevice"], [_decorator.bound, 2, "stopSpeakerTest"], [_decorator.bound, 2, "startSpeakerTest"], [_decorator.bound, 2, "setSpeakerDevice"], [_decorator.bound, 2, "setSpeakerVolume"], [_decorator.bound, 2, "setMicrophoneVolume"], [_decorator.bound, 2, "setVideoOrientation"], [_decorator.bound, 2, "setBeautyOptions"], [_decorator.bound, 2, "toggleLocalMirrorPreview"], [_decorator.bound, 2, "startVideo"], [_decorator.bound, 2, "stopVideo"], [_decorator.bound, 2, "handleForceOpenVideoEffect"], [_decorator.bound, 2, "handleCancelForceOpenVideoEffect"], [_decorator.bound, 2, "toggleLocalMirror"], [_decorator.bound, 2, "_syncSystemInfo"], [_setDialogConfigDecs, 18, "setDialogConfig"], [_setSettingDecs, 18, "setSetting"], [_onEventDecs, 18, "_onEvent"], [_onNetworkStatsUpdatedDecs, 18, "_onNetworkStatsUpdated"], [_calculateSystemInfoDecs, 18, "calculateSystemInfo"], [_getSystemInformationDecs, 18, "getSystemInformation"], [_clearGetSystemInfoIntervalDecs, 18, "clearGetSystemInfoInterval"], [_onLocalAudioStatsUpdatedDecs, 18, "_onLocalAudioStatsUpdated"], [_onRemoteAudioStatsUpdatedDecs, 18, "_onRemoteAudioStatsUpdated"], [_onLocalVideoStatsUpdatedDecs, 18, "_onLocalVideoStatsUpdated"], [_onRemoteVideoStatsUpdatedDecs, 18, "_onRemoteVideoStatsUpdated"], [_onStreamsUpdatedDecs, 18, "_onStreamsUpdated"], [_onStreamsRemovedDecs, 18, "_onStreamsRemoved"], [_onPerformanceUpdatedDecs, 18, "_onPerformanceUpdated"], [_closeDialogDecs, 18, "closeDialog"]], []).e, 14);
1022
- _init_isWifiConnected = _applyDecs$e[0];
1023
- _init_dialogConfig = _applyDecs$e[1];
1024
- _init_networkState = _applyDecs$e[2];
1025
- _init_performanceState = _applyDecs$e[3];
1026
- _init_localAudioStreamMap = _applyDecs$e[4];
1027
- _init_remoteAudioStreamMap = _applyDecs$e[5];
1028
- _init_localVideoStreamMap = _applyDecs$e[6];
1029
- _init_remoteVideoStreamMap = _applyDecs$e[7];
1030
- _init_systemMemorySize = _applyDecs$e[8];
1031
- _init_systemCpuDesc = _applyDecs$e[9];
1032
- _init_setting = _applyDecs$e[10];
1033
- _init_config = _applyDecs$e[11];
1034
- _init_getSystemInfoTimer = _applyDecs$e[12];
1035
- _initProto = _applyDecs$e[13];